mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix bug #6762. Silly mistake.
Also, disable corresponding code for required arguments. tex2lyx does not produce a high enough file format yet for this to make sense, I don't think. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34635 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2052c1e7cc
commit
22c1d47b02
@ -457,29 +457,34 @@ void output_command_layout(ostream & os, Parser & p, bool outer,
|
||||
unsigned int optargs = 0;
|
||||
while (optargs < context.layout->optargs) {
|
||||
eat_whitespace(p, os, context, false);
|
||||
if (p.next_token().character() == '[') {
|
||||
p.get_token(); // eat '['
|
||||
begin_inset(os, "OptArg\n");
|
||||
os << "status collapsed\n\n";
|
||||
parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context);
|
||||
end_inset(os);
|
||||
eat_whitespace(p, os, context, false);
|
||||
optargs++;
|
||||
}
|
||||
if (p.next_token().character() != '[')
|
||||
break;
|
||||
p.get_token(); // eat '['
|
||||
begin_inset(os, "OptArg\n");
|
||||
os << "status collapsed\n\n";
|
||||
parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context);
|
||||
end_inset(os);
|
||||
eat_whitespace(p, os, context, false);
|
||||
optargs++;
|
||||
}
|
||||
#if 0
|
||||
// This is the code needed to parse required arguments, but
|
||||
// required arguments come into being only much later than the
|
||||
// file format tex2lyx is presently outputting.
|
||||
unsigned int reqargs = 0;
|
||||
while (reqargs < context.layout->reqargs) {
|
||||
eat_whitespace(p, os, context, false);
|
||||
if (p.next_token().character() == '{') {
|
||||
p.get_token(); // eat '['
|
||||
begin_inset(os, "OptArg\n");
|
||||
os << "status collapsed\n\n";
|
||||
parse_text_in_inset(p, os, FLAG_BRACE_LAST, outer, context);
|
||||
end_inset(os);
|
||||
eat_whitespace(p, os, context, false);
|
||||
reqargs++;
|
||||
}
|
||||
if (p.next_token().character() != '{')
|
||||
break;
|
||||
p.get_token(); // eat '{'
|
||||
begin_inset(os, "OptArg\n");
|
||||
os << "status collapsed\n\n";
|
||||
parse_text_in_inset(p, os, FLAG_BRACE_LAST, outer, context);
|
||||
end_inset(os);
|
||||
eat_whitespace(p, os, context, false);
|
||||
reqargs++;
|
||||
}
|
||||
#endif
|
||||
parse_text(p, os, FLAG_ITEM, outer, context);
|
||||
context.check_end_layout(os);
|
||||
if (parent_context.deeper_paragraph) {
|
||||
|
Loading…
Reference in New Issue
Block a user