From: Richard Heck Date: Wed, 9 Jun 2010 15:08:04 +0000 (+0000) Subject: Fix bug #6762. Silly mistake. X-Git-Tag: 2.0.0~3151 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=22c1d47b02d7a47c88f52d5f28dc1132c5bfed94;p=features.git 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 --- diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index ab6a101706..4f5b60e609 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -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) {