Distinguish between empty argument and no argument

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40141 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-11-06 17:32:15 +00:00
parent 93d6ce915f
commit 491bad7b00

View 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