Allow alignment customization in environments.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35398 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-09-15 17:29:51 +00:00
parent 64241a6d6d
commit 3c08472b0c

View File

@ -503,7 +503,8 @@ inline void openTag(XHTMLStream & xs, Layout const & lay)
}
void openTag(XHTMLStream & xs, Layout const & lay, ParagraphParameters const & params)
void openTag(XHTMLStream & xs, Layout const & lay,
ParagraphParameters const & params)
{
// FIXME Are there other things we should handle here?
string const align = alignmentToCSS(params.align());
@ -540,6 +541,20 @@ inline void openItemTag(XHTMLStream & xs, Layout const & lay)
}
void openItemTag(XHTMLStream & xs, Layout const & lay,
ParagraphParameters const & params)
{
// FIXME Are there other things we should handle here?
string const align = alignmentToCSS(params.align());
if (align.empty()) {
openItemTag(xs, lay);
return;
}
string attrs = lay.htmlattr() + " style='text-align: " + align + ";'";
xs << html::StartTag(lay.htmlitemtag(), attrs);
}
inline void closeItemTag(XHTMLStream & xs, Layout const & lay)
{
xs << html::EndTag(lay.htmlitemtag());
@ -722,7 +737,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
bool const labelfirst = style.htmllabelfirst();
if (!labelfirst)
openItemTag(xs, style);
openItemTag(xs, style, par->params());
// label output
if (style.labeltype != LABEL_NO_LABEL &&
@ -757,7 +772,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
} // end label output
if (labelfirst)
openItemTag(xs, style);
openItemTag(xs, style, par->params());
par->simpleLyXHTMLOnePar(buf, xs, runparams,
text.outerFont(distance(begin, par)), sep);