]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Inset::addToToc(): change signature. Use DocIterator instead of ParConstIterator...
[lyx.git] / src / insets / InsetCommand.cpp
index a7bb9955e3b6448c969edc7e1bb63cc19ebd6e0f..bbe81841338d323d46584a85032ed8db0f1e9df3 100644 (file)
@@ -196,29 +196,12 @@ bool InsetCommand::string2params(string const & name, string const & in,
        params.clear();
        if (in.empty())
                return false;
-
        istringstream data(in);
        Lexer lex;
        lex.setStream(data);
-
-       string n;
-       lex >> n;
-       if (!lex || n != name) {
-               LYXERR0("InsetCommand::string2params(" << in << ")\n"
-                                         "Expected arg 1 to be \"" << name << "\"\n");
-               return false;
-       }
-
-       // This is part of the inset proper that is usually swallowed
-       // by Text::readInset
-       string id;
-       lex >> id;
-       if (!lex || id != "CommandInset") {
-               LYXERR0("InsetCommand::string2params(" << in << ")\n"
-                                         "Expected arg 2 to be \"CommandInset\"\n");
-               return false;
-       }
-
+       lex.setContext("InsetCommand::string2params");
+       lex >> name.c_str(); // check for name
+       lex >> "CommandInset";
        params.read(lex);
        return true;
 }