Add routine to create default CSS for layouts.

JMarc (or others), please check the #ifdef here. If you'd prefer to 
do this some other way, let me know.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31766 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2009-10-27 13:30:53 +00:00
parent c2b8eeaf96
commit 80cc7e99f2

View File

@ -929,9 +929,32 @@ docstring Layout::htmlstyle() const {
}
// NOTE There is a whole ton of stuff that could go into this.
// Things like bottomsep, topsep, and parsep could become various
// sorts of margins or padding, for example. But for now we are
// going to keep it simple.
void Layout::makeDefaultCSS() const {
// FIXME just an empty hook for now.
// i'll get to this shortly.
#ifdef TEX2LYX
// tex2lyx does not have FontInfo::asCSS()
return;
#else
// this never needs to be redone, since reloading layouts will
// wipe out what we did before.
if (!htmldefaultstyle_.empty())
return;
docstring const mainfontCSS = font.asCSS();
if (!mainfontCSS.empty())
htmldefaultstyle_ =
from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
mainfontCSS + from_ascii("\n}\n");
if (labelfont == font || htmllabeltag() == "NONE")
return;
docstring const labelfontCSS = labelfont.asCSS();
if (!labelfontCSS.empty())
htmldefaultstyle_ +=
from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
labelfontCSS + from_ascii("\n}\n");
#endif
}