mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
In certain cases, we are going to need to write the outer tag, etc, in a
derived class and then will not want to write it again here. So this gives us that ability. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32132 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
27ed87b8f9
commit
502e764584
@ -496,6 +496,13 @@ int InsetText::docbook(odocstream & os, OutputParams const & runparams) const
|
|||||||
|
|
||||||
|
|
||||||
docstring InsetText::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
|
docstring InsetText::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
|
||||||
|
{
|
||||||
|
return insetAsXHTML(xs, runparams, WriteEverything);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & runparams,
|
||||||
|
XHTMLOptions opts) const
|
||||||
{
|
{
|
||||||
if (undefined()) {
|
if (undefined()) {
|
||||||
xhtmlParagraphs(text_, buffer(), xs, runparams);
|
xhtmlParagraphs(text_, buffer(), xs, runparams);
|
||||||
@ -503,8 +510,9 @@ docstring InsetText::xhtml(XHTMLStream & xs, OutputParams const & runparams) con
|
|||||||
}
|
}
|
||||||
|
|
||||||
InsetLayout const & il = getLayout();
|
InsetLayout const & il = getLayout();
|
||||||
|
if (opts & WriteOuterTag)
|
||||||
xs << StartTag(il.htmltag(), il.htmlattr());
|
xs << StartTag(il.htmltag(), il.htmlattr());
|
||||||
if (!il.counter().empty()) {
|
if ((opts & WriteLabel) && !il.counter().empty()) {
|
||||||
BufferParams const & bp = buffer().masterBuffer()->params();
|
BufferParams const & bp = buffer().masterBuffer()->params();
|
||||||
Counters & cntrs = bp.documentClass().counters();
|
Counters & cntrs = bp.documentClass().counters();
|
||||||
cntrs.step(il.counter());
|
cntrs.step(il.counter());
|
||||||
@ -521,6 +529,7 @@ docstring InsetText::xhtml(XHTMLStream & xs, OutputParams const & runparams) con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts & WriteInnerTag)
|
||||||
xs << StartTag(il.htmlinnertag(), il.htmlinnerattr());
|
xs << StartTag(il.htmlinnertag(), il.htmlinnerattr());
|
||||||
if (il.isMultiPar())
|
if (il.isMultiPar())
|
||||||
xhtmlParagraphs(text_, buffer(), xs, runparams);
|
xhtmlParagraphs(text_, buffer(), xs, runparams);
|
||||||
@ -529,7 +538,9 @@ docstring InsetText::xhtml(XHTMLStream & xs, OutputParams const & runparams) con
|
|||||||
ours.html_make_pars = false;
|
ours.html_make_pars = false;
|
||||||
xhtmlParagraphs(text_, buffer(), xs, ours);
|
xhtmlParagraphs(text_, buffer(), xs, ours);
|
||||||
}
|
}
|
||||||
|
if (opts & WriteInnerTag)
|
||||||
xs << EndTag(il.htmlinnertag());
|
xs << EndTag(il.htmlinnertag());
|
||||||
|
if (opts & WriteOuterTag)
|
||||||
xs << EndTag(il.htmltag());
|
xs << EndTag(il.htmltag());
|
||||||
return docstring();
|
return docstring();
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,17 @@ public:
|
|||||||
int docbook(odocstream &, OutputParams const &) const;
|
int docbook(odocstream &, OutputParams const &) const;
|
||||||
///
|
///
|
||||||
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
||||||
|
///
|
||||||
|
enum XHTMLOptions {
|
||||||
|
JustText = 0,
|
||||||
|
WriteOuterTag = 1,
|
||||||
|
WriteLabel = 2,
|
||||||
|
WriteInnerTag = 4,
|
||||||
|
WriteEverything = 7
|
||||||
|
};
|
||||||
|
///
|
||||||
|
docstring insetAsXHTML(XHTMLStream &, OutputParams const &,
|
||||||
|
XHTMLOptions) const;
|
||||||
// FIXME XHTMLStream to be removed
|
// FIXME XHTMLStream to be removed
|
||||||
docstring xhtml(odocstream &, OutputParams const &) const
|
docstring xhtml(odocstream &, OutputParams const &) const
|
||||||
{ return docstring (); }
|
{ return docstring (); }
|
||||||
|
Loading…
Reference in New Issue
Block a user