]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/tex2lyx.cpp
* src/insets/InsetNote.h:
[lyx.git] / src / tex2lyx / tex2lyx.cpp
index 790cf4a3a71ac19336eb46fab879a22a8adb42ba..6890b370c823fe0c1bf8ce3c00fdf5cf49df2206 100644 (file)
@@ -25,7 +25,6 @@
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Package.h"
-#include "support/unicode.h"
 
 #include <fstream>
 #include <iostream>
@@ -111,7 +110,7 @@ CommandMap known_math_environments;
 
 
 void add_known_command(string const & command, string const & o1,
-                      bool o2)
+       unsigned optionalsNum)
 {
        // We have to handle the following cases:
        // definition                      o1    o2    invocation result
@@ -127,8 +126,7 @@ void add_known_command(string const & command, string const & o1,
        if (isStrUnsignedInt(opt1)) {
                // The command has arguments
                nargs = convert<unsigned int>(opt1);
-               if (nargs > 0 && o2) {
-                       // The first argument is optional
+               for (unsigned int i = 0; i < optionalsNum; ++i) {
                        arguments.push_back(optional);
                        --nargs;
                }
@@ -399,7 +397,8 @@ void tex2lyx(istream & is, ostream & os)
        //p.dump();
 
        stringstream ss;
-       TextClass textclass = parse_preamble(p, ss, documentclass);
+       TeX2LyXDocClass textclass;
+       parse_preamble(p, ss, documentclass, textclass);
        captionlayout = LayoutPtr(Layout::forCaption());
 
        active_environments.push_back("document");