X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetText.cpp;h=41427ce7c3326c22838e4842a400bf8329cd7015;hb=9c0281126e5b819a6c10afa1bb585b76cdc4dca2;hp=583bd82b5725960fd068da29e96ac72500ae58e8;hpb=31e25c8ec695f864bec3679c3e11495e3011a0e2;p=lyx.git diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 583bd82b57..41427ce7c3 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -27,7 +27,6 @@ #include "ErrorList.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "InsetCaption.h" #include "InsetList.h" #include "Intl.h" #include "Language.h" @@ -227,8 +226,8 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const pi.backgroundColor(this)); // Change color of the frame in tracked changes, like for tabulars. - // Only do so if the color is not custom. But do so even if RowPainter - // handles the strike-through already. + // Only do so if the color is not custom. But do so even if RowPainter + // handles the strike-through already. Color c; if (pi.change_.changed() // Originally, these are the colors with role Text, from role() in @@ -613,9 +612,9 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp, runparams.par_end = text().paragraphs().size(); if (undefined()) { - xs.startParagraph(false); + xs.startDivision(false); xhtmlParagraphs(text_, buffer(), xs, runparams); - xs.endParagraph(); + xs.endDivision(); return docstring(); } @@ -649,9 +648,9 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp, if (il.isPassThru()) runparams.pass_thru = true; - xs.startParagraph(false); + xs.startDivision(false); xhtmlParagraphs(text_, buffer(), xs, runparams); - xs.endParagraph(); + xs.endDivision(); if (opts & WriteInnerTag) xs << html::EndTag(il.htmlinnertag()); @@ -1019,52 +1018,6 @@ docstring InsetText::toolTipText(docstring prefix, size_t const len) const } -InsetCaption const * InsetText::getCaptionInset() const -{ - ParagraphList::const_iterator pit = paragraphs().begin(); - for (; pit != paragraphs().end(); ++pit) { - InsetList::const_iterator it = pit->insetList().begin(); - for (; it != pit->insetList().end(); ++it) { - Inset & inset = *it->inset; - if (inset.lyxCode() == CAPTION_CODE) { - InsetCaption const * ins = - static_cast(it->inset); - return ins; - } - } - } - return 0; -} - - -docstring InsetText::getCaptionText(OutputParams const & runparams) const -{ - InsetCaption const * ins = getCaptionInset(); - if (ins == 0) - return docstring(); - - odocstringstream ods; - ins->getCaptionAsPlaintext(ods, runparams); - return ods.str(); -} - - -docstring InsetText::getCaptionHTML(OutputParams const & runparams) const -{ - InsetCaption const * ins = getCaptionInset(); - if (ins == 0) - return docstring(); - - odocstringstream ods; - XHTMLStream xs(ods); - docstring def = ins->getCaptionAsHTML(xs, runparams); - if (!def.empty()) - // should already have been escaped - xs << XHTMLStream::ESCAPE_NONE << def << '\n'; - return ods.str(); -} - - InsetText::XHTMLOptions operator|(InsetText::XHTMLOptions a1, InsetText::XHTMLOptions a2) { return static_cast((int)a1 | (int)a2);