From b743c226ca07bd04ba5b146e2e920ddc34b1541b Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 15 Sep 2010 14:42:50 +0000 Subject: [PATCH] Handle forced alignments, at least in ordinary paragraphs. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35395 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/doc/Customization.lyx | 48 +++++++++++++++++++++++++++++++++++++++ src/output_xhtml.cpp | 15 +++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx index 0cdfa07abf..6503593ba7 100644 --- a/lib/doc/Customization.lyx +++ b/lib/doc/Customization.lyx @@ -16765,6 +16765,22 @@ layoutname \end_inset is the LyX name of the layout, made lowercase, for example: chapter. + This should +\emph on +not +\emph default + contain any style information. + Use +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +HTMLStyle +\end_layout + +\end_inset + + for that purpose. \end_layout \begin_layout Description @@ -16913,6 +16929,22 @@ class=`layoutname_item' \end_inset . + This should +\emph on +not +\emph default + contain any style information. + Use +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +HTMLStyle +\end_layout + +\end_inset + + for that purpose. \end_layout \begin_layout Description @@ -17039,6 +17071,22 @@ class=`layoutname_label' \end_inset . + This should +\emph on +not +\emph default + contain any style information. + Use +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +HTMLStyle +\end_layout + +\end_inset + + for that purpose. \end_layout \begin_layout Description diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index cc1c9a9662..0c6c61b162 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -491,6 +491,19 @@ inline void openTag(XHTMLStream & xs, Layout const & lay) } +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()); + if (align.empty()) { + openTag(xs, lay); + return; + } + string attrs = lay.htmlattr() + " style='text-align: " + align + ";'"; + xs << html::StartTag(lay.htmltag(), attrs); +} + + inline void closeTag(XHTMLStream & xs, Layout const & lay) { xs << html::EndTag(lay.htmltag()); @@ -587,7 +600,7 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf, bool const opened = runparams.html_make_pars && (par != pbegin || !runparams.html_in_par); if (opened) - openTag(xs, lay); + openTag(xs, lay, par->params()); docstring const deferred = par->simpleLyXHTMLOnePar(buf, xs, runparams, text.outerFont(distance(begin, par))); -- 2.39.2