Get default font color and background color working for XHTML export.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39679 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-09-15 21:22:56 +00:00
parent eff76bd3ab
commit 3788b960f8

View File

@ -713,10 +713,10 @@ int Buffer::readHeader(Lexer & lex)
params().indiceslist().clear();
params().backgroundcolor = lyx::rgbFromHexName("#ffffff");
params().isbackgroundcolor = false;
params().fontcolor = lyx::rgbFromHexName("#000000");
params().fontcolor = RGBColor(0, 0, 0);
params().isfontcolor = false;
params().notefontcolor = lyx::rgbFromHexName("#cccccc");
params().boxbgcolor = lyx::rgbFromHexName("#ff0000");
params().notefontcolor = RGBColor(0xCC, 0xCC, 0xCC);
params().boxbgcolor = RGBColor(0xFF, 0, 0);
params().html_latex_start.clear();
params().html_latex_end.clear();
params().html_math_img_scale = 1.0;
@ -1642,6 +1642,21 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
<< styleinfo
<< "</style>\n";
}
bool const needfg = params().fontcolor != RGBColor(0, 0, 0);
bool const needbg = params().backgroundcolor != RGBColor(OxFF, OxFF, OxFF);
if (needfg || needbg) {
os << "<style type='text/css'>\nbody {\n";
if (needfg)
os << " color: "
<< from_ascii(X11hexname(params().fontcolor))
<< ";\n";
if (needbg)
os << " background-color: "
<< from_ascii(X11hexname(params().backgroundcolor))
<< ";\n";
os << "}\n</style>\n";
}
os << "</head>\n<body>\n";
}