]> git.lyx.org Git - lyx.git/commitdiff
tex2lyx/text.cpp: code improvement as proposed by Georg
authorUwe Stöhr <uwestoehr@lyx.org>
Thu, 15 Mar 2012 01:10:13 +0000 (02:10 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Thu, 15 Mar 2012 01:10:13 +0000 (02:10 +0100)
src/tex2lyx/text.cpp

index e083e39ec8a147e8104186f1e8167e3e31103722..0581eab8475121bccca5c46db12878428593d91f 100644 (file)
@@ -1123,14 +1123,7 @@ void parse_listings(Parser & p, ostream & os, Context & parent_context, bool in_
        parent_context.check_layout(os);
        begin_inset(os, "listings\n");
        if (p.hasOpt()) {
-               // there can be a [] pair inside the argument for the language
-               string arg = p.getArg('[', ']');
-               if (arg.find("language={[") != string::npos) {
-                       char start = p.next_token().character();
-                       arg += ']';
-                       arg += start;
-                       arg += p.getArg(start, ']');
-               }
+               string arg = p.verbatimOption();
                os << "lstparams " << '"' << arg << '"' << '\n';
        }
        if (in_line)