]> git.lyx.org Git - features.git/commitdiff
Distinguish between empty argument and no argument
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Sun, 6 Nov 2011 17:32:15 +0000 (17:32 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Sun, 6 Nov 2011 17:32:15 +0000 (17:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40141 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/Preamble.cpp

index f7f219281d0805580d8d4c439f3160365abf5a8a..c0b3cb9ac4cc9e81d54b889f10a42c6a6ec3cb14 100644 (file)
@@ -1035,7 +1035,7 @@ void Preamble::parse(Parser & p, string const & forceclass,
 
                else if (t.cs() == "color") {
                        string const space =
-                               (p.hasOpt() ? p.getArg('[', ']') : string());
+                               (p.hasOpt() ? p.getOpt() : string());
                        string argument = p.getArg('{', '}');
                        // check the case that a standard color is used
                        if (space.empty() && is_known(argument, known_basic_colors)) {
@@ -1048,7 +1048,7 @@ void Preamble::parse(Parser & p, string const & forceclass,
                        else {
                                h_preamble << t.asInput();
                                if (!space.empty())
-                                       h_preamble << '[' << space << ']';
+                                       h_preamble << space;
                                h_preamble << '{' << argument << '}';
                                // the color might already be set because \definecolor
                                // is parsed before this