listings_params = string();
pagestyle = "default";
suppress_date = false;
- // white is equal to no background color
+ // no color is the default (white)
backgroundcolor = lyx::rgbFromHexName("#ffffff");
+ isbackgroundcolor = false;
// no color is the default (black)
fontcolor = lyx::rgbFromHexName("#000000");
isfontcolor = false;
} else if (token == "\\backgroundcolor") {
lex.eatLine();
backgroundcolor = lyx::rgbFromHexName(lex.getString());
+ isbackgroundcolor = true;
} else if (token == "\\fontcolor") {
lex.eatLine();
fontcolor = lyx::rgbFromHexName(lex.getString());
string color = lex.getString();
notefontcolor = lyx::rgbFromHexName(color);
// set the font color within LyX
+ // FIXME: the color is correctly set but later overwritten by the default
lcolor.setColor(Color_greyedouttext, color);
} else if (token == "\\paperwidth") {
lex >> paperwidth;
<< "\n\\paperorientation " << string_orientation[orientation]
<< "\n\\suppress_date " << convert<string>(suppress_date)
<< '\n';
- if (backgroundcolor != lyx::rgbFromHexName("#ffffff"))
+ if (isbackgroundcolor == true)
os << "\\backgroundcolor " << lyx::X11hexname(backgroundcolor) << '\n';
- if (isfontcolor == true)
+ if (isfontcolor == true)
os << "\\fontcolor " << lyx::X11hexname(fontcolor) << '\n';
- if (notefontcolor != lyx::rgbFromHexName("#cccccc"))
+ if (notefontcolor != lyx::rgbFromHexName("#cccccc"))
os << "\\notefontcolor " << lyx::X11hexname(notefontcolor) << '\n';
BranchList::const_iterator it = branchlist().begin();
texrow.newline();
}
- // only output when the background color is not white
- if (backgroundcolor != lyx::rgbFromHexName("#ffffff")) {
+ // only output when the background color is not default
+ if (isbackgroundcolor == true) {
// only require color here, the background color will be defined
// in LaTeXFeatures.cpp to avoid interferences with the LaTeX
// package pdfpages
features.require("pagecolor");
}
- // only output when the font color is not black
+ // only output when the font color is not default
if (isfontcolor == true) {
// only require color here, the font color will be defined
// in LaTeXFeatures.cpp to avoid interferences with the LaTeX