mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 15:01:58 +00:00
fix parsing of \def macros (was broken with the spreadsheet template support)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40363 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
07b2ffa469
commit
169bc143cb
@ -2326,12 +2326,19 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
|
|
||||||
else if (is_macro(p)) {
|
else if (is_macro(p)) {
|
||||||
// catch the case of \def\inputGnumericTable
|
// catch the case of \def\inputGnumericTable
|
||||||
|
bool macro = true;
|
||||||
if (t.cs() == "def") {
|
if (t.cs() == "def") {
|
||||||
Token second = p.get_token();
|
Token second = p.next_token();
|
||||||
if (second.cs() == "inputGnumericTable") {
|
if (second.cs() == "inputGnumericTable") {
|
||||||
|
p.pushPosition();
|
||||||
|
p.get_token();
|
||||||
skip_braces(p);
|
skip_braces(p);
|
||||||
Token third = p.get_token();
|
Token third = p.get_token();
|
||||||
|
p.popPosition();
|
||||||
if (third.cs() == "input") {
|
if (third.cs() == "input") {
|
||||||
|
p.get_token();
|
||||||
|
skip_braces(p);
|
||||||
|
p.get_token();
|
||||||
string name = normalize_filename(p.verbatim_item());
|
string name = normalize_filename(p.verbatim_item());
|
||||||
string const path = getMasterFilePath();
|
string const path = getMasterFilePath();
|
||||||
// We want to preserve relative / absolute filenames,
|
// We want to preserve relative / absolute filenames,
|
||||||
@ -2357,10 +2364,11 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
<< name << "\n";
|
<< name << "\n";
|
||||||
end_inset(os);
|
end_inset(os);
|
||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
|
macro = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_macro(p))
|
if (macro)
|
||||||
parse_macro(p, os, context);
|
parse_macro(p, os, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user