]> git.lyx.org Git - features.git/commitdiff
Remove InsetArgument 999 workaround
authorGeorg Baum <baum@lyx.org>
Fri, 26 Dec 2014 21:13:09 +0000 (22:13 +0100)
committerGeorg Baum <baum@lyx.org>
Sat, 27 Dec 2014 14:17:11 +0000 (15:17 +0100)
Since we iterate through all arguments we can as well compute the correct id
directly.

src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/test/test.lyx.lyx
src/tex2lyx/text.cpp

index 6a52a847eef38ad664bc08099611970e8cc84252..107bb669e153c37cf57b852a0c2571b5acb72855 100644 (file)
@@ -188,7 +188,7 @@ A section
 
 \begin_layout Section
 
-\begin_inset Argument 999
+\begin_inset Argument 1
 status collapsed
 
 
index c7b6dd5e692398c1ccb9c525dbbd42986a38f8d1..d1da45bafae357622416be97d8be4f3c3ed797f2 100644 (file)
@@ -349,7 +349,7 @@ Final text
 \end_deeper
 \begin_layout Section
 
-\begin_inset Argument 999
+\begin_inset Argument 1
 status collapsed
 
 
index 6ab15497027caf13987d26047cef8303c28466cc..721db0ce6bb9212a386ed3e5a03663d1854ac7a7 100644 (file)
@@ -637,21 +637,18 @@ void output_command_layout(ostream & os, Parser & p, bool outer,
        }
        context.check_deeper(os);
        context.check_layout(os);
+       int i = 0;
        Layout::LaTeXArgMap::const_iterator lait = context.layout->latexargs().begin();
        Layout::LaTeXArgMap::const_iterator const laend = context.layout->latexargs().end();
        for (; lait != laend; ++lait) {
+               ++i;
                eat_whitespace(p, os, context, false);
                if (lait->second.mandatory) {
                        if (p.next_token().cat() != catBegin)
                                break;
                        p.get_token(); // eat '{'
-                       // FIXME: Just a workaround. InsetArgument::updateBuffer
-                       //        will compute a proper ID for all "999" Arguments
-                       //        (which is also what lyx2lyx produces).
-                       //        However, tex2lyx should be able to output proper IDs
-                       //        itself.
-                       begin_inset(os, "Argument 999\n");
-                       os << "status collapsed\n\n";
+                       begin_inset(os, "Argument ");
+                       os << i << "\nstatus collapsed\n\n";
                        parse_text_in_inset(p, os, FLAG_BRACE_LAST, outer, context);
                        end_inset(os);
                } else {
@@ -659,13 +656,8 @@ void output_command_layout(ostream & os, Parser & p, bool outer,
                            p.next_token().character() != '[')
                                break;
                        p.get_token(); // eat '['
-                       // FIXME: Just a workaround. InsetArgument::updateBuffer
-                       //        will compute a proper ID for all "999" Arguments
-                       //        (which is also what lyx2lyx produces).
-                       //        However, tex2lyx should be able to output proper IDs
-                       //        itself.
-                       begin_inset(os, "Argument 999\n");
-                       os << "status collapsed\n\n";
+                       begin_inset(os, "Argument ");
+                       os << i << "\nstatus collapsed\n\n";
                        parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context);
                        end_inset(os);
                }