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;
// light gray is the default font color for greyed-out notes
notefontcolor = lyx::rgbFromHexName("#cccccc");
+ boxbgcolor = lyx::rgbFromHexName("#ff0000");
compressed = lyxrc.save_compressed;
for (int iter = 0; iter < 4; ++iter) {
user_defined_bullet(iter) = ITEMIZE_DEFAULTS[iter];
} 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 == "\\boxbgcolor") {
+ lex.eatLine();
+ string color = lex.getString();
+ boxbgcolor = lyx::rgbFromHexName(color);
+ // set the font color within LyX
+ lcolor.setColor(Color_shadedbg, color);
} else if (token == "\\paperwidth") {
lex >> paperwidth;
} else if (token == "\\paperheight") {
<< "\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)
os << "\\fontcolor " << lyx::X11hexname(fontcolor) << '\n';
if (notefontcolor != lyx::rgbFromHexName("#cccccc"))
os << "\\notefontcolor " << lyx::X11hexname(notefontcolor) << '\n';
+ if (boxbgcolor != lyx::rgbFromHexName("#ff0000"))
+ os << "\\boxbgcolor " << lyx::X11hexname(boxbgcolor) << '\n';
BranchList::const_iterator it = branchlist().begin();
BranchList::const_iterator end = branchlist().end();
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
LayoutFileList & bcl = LayoutFileList::get();
if (!bcl.haveClass(classname)) {
docstring s =
- bformat(_("The document class %1$s could not be found. "
- "A default textclass with default layouts will be used. "
- "LyX might not be able to produce output unless a correct "
- "textclass is selected from the document settings dialog."),
+ bformat(_("The layout file:\n"
+ "%1$s\n"
+ "could not be found. A default textclass with default\n"
+ "layouts will be used. LyX will not be able to produce\n"
+ "correct output."),
from_utf8(classname));
frontend::Alert::error(_("Document class not found"), s);
bcl.addEmptyClass(classname);
bool const success = bcl[classname].load();
if (!success) {
docstring s =
- bformat(_("The document class %1$s could not be loaded."),
+ bformat(_("Due to some error in it, the layout file:\n"
+ "%1$s\n"
+ "could not be loaded. A default textclass with default\n"
+ "layouts will be used. LyX will not be able to produce\n"
+ "correct output."),
from_utf8(classname));
frontend::Alert::error(_("Could not load class"), s);
- return false;
+ bcl.addEmptyClass(classname);
}
pimpl_->baseClass_ = classname;
}
}
+
bool BufferParams::moduleCanBeAdded(string const & modName) const
{
return layoutModules_.moduleCanBeAdded(modName, baseClass());