mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
Multiple external requirements
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9780 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e9ac548c9a
commit
958bd96f53
@ -1,3 +1,8 @@
|
|||||||
|
2005-04-05 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
|
* insetexternal.C (validate):
|
||||||
|
* ExternalTemplate.[Ch] (dumpFormat, readFormat): allow
|
||||||
|
multiple Requirements in external material template
|
||||||
|
|
||||||
2005-04-03 Alfredo Braunstein <abraunst@lyx.org>
|
2005-04-03 Alfredo Braunstein <abraunst@lyx.org>
|
||||||
|
|
||||||
|
@ -126,8 +126,14 @@ public:
|
|||||||
ost << "\tFormat " << vt.first << '\n'
|
ost << "\tFormat " << vt.first << '\n'
|
||||||
<< "\t\tProduct " << ft.product << '\n'
|
<< "\t\tProduct " << ft.product << '\n'
|
||||||
<< "\t\tUpdateFormat " << ft.updateFormat << '\n'
|
<< "\t\tUpdateFormat " << ft.updateFormat << '\n'
|
||||||
<< "\t\tUpdateResult " << ft.updateResult << '\n'
|
<< "\t\tUpdateResult " << ft.updateResult << '\n';
|
||||||
<< "\t\tRequirement " << ft.requirement << '\n';
|
|
||||||
|
vector<string>::const_iterator qit = ft.requirements.begin();
|
||||||
|
vector<string>::const_iterator qend = ft.requirements.end();
|
||||||
|
for (; qit != qend; ++qit) {
|
||||||
|
lyxerr << "req:" << *qit << std::endl;
|
||||||
|
ost << "\t\tRequirement " << *qit << '\n';
|
||||||
|
}
|
||||||
|
|
||||||
typedef vector<Template::Option> Options;
|
typedef vector<Template::Option> Options;
|
||||||
Options::const_iterator oit = ft.options.begin();
|
Options::const_iterator oit = ft.options.begin();
|
||||||
@ -502,7 +508,7 @@ void Template::Format::readFormat(LyXLex & lex)
|
|||||||
|
|
||||||
case FO_REQUIREMENT:
|
case FO_REQUIREMENT:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
requirement = lex.getString();
|
requirements.push_back(lex.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FO_PREAMBLE:
|
case FO_PREAMBLE:
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
/// The format of this file.
|
/// The format of this file.
|
||||||
std::string updateFormat;
|
std::string updateFormat;
|
||||||
/// What features does this external inset require?
|
/// What features does this external inset require?
|
||||||
std::string requirement;
|
std::vector<std::string> requirements;
|
||||||
/// A collection of preamble snippets identified by name.
|
/// A collection of preamble snippets identified by name.
|
||||||
std::vector<std::string> preambleNames;
|
std::vector<std::string> preambleNames;
|
||||||
/// A list of options to the basic command.
|
/// A list of options to the basic command.
|
||||||
|
@ -737,13 +737,15 @@ void InsetExternal::validate(LaTeXFeatures & features) const
|
|||||||
if (cit == et.formats.end())
|
if (cit == et.formats.end())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!cit->second.requirement.empty())
|
vector<string>::const_iterator it = cit->second.requirements.begin();
|
||||||
features.require(cit->second.requirement);
|
vector<string>::const_iterator end = cit->second.requirements.end();
|
||||||
|
for (; it != end; ++it)
|
||||||
|
features.require(*it);
|
||||||
|
|
||||||
external::TemplateManager & etm = external::TemplateManager::get();
|
external::TemplateManager & etm = external::TemplateManager::get();
|
||||||
|
|
||||||
vector<string>::const_iterator it = cit->second.preambleNames.begin();
|
it = cit->second.preambleNames.begin();
|
||||||
vector<string>::const_iterator end = cit->second.preambleNames.end();
|
end = cit->second.preambleNames.end();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
string const preamble = etm.getPreambleDefByName(*it);
|
string const preamble = etm.getPreambleDefByName(*it);
|
||||||
if (!preamble.empty())
|
if (!preamble.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user