From 33c665676952a3883bef162aeda554c4d3e7c2d1 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 19 Jun 2009 13:16:27 +0000 Subject: [PATCH] Move these, too, so they can be used in InsetListings, and maybe even elsewhere. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30184 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetCollapsable.cpp | 32 ++++++++++++++++++++++++++++++++ src/insets/InsetCollapsable.h | 4 ++++ src/insets/InsetFloat.cpp | 32 -------------------------------- src/insets/InsetFloat.h | 4 ---- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index ef9fba98c2..b12cb7025d 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -802,6 +802,38 @@ InsetCaption const * InsetCollapsable::getCaptionInset() const } +docstring InsetCollapsable::getCaptionText(OutputParams const & runparams) const +{ + if (paragraphs().empty()) + return docstring(); + + InsetCaption const * ins = getCaptionInset(); + if (ins == 0) + return docstring(); + + odocstringstream ods; + ins->getCaptionText(ods, runparams); + return ods.str(); +} + + +docstring InsetCollapsable::getCaptionHTML(OutputParams const & runparams) const +{ + if (paragraphs().empty()) + return docstring(); + + InsetCaption const * ins = getCaptionInset(); + if (ins == 0) + return docstring(); + + odocstringstream ods; + docstring def = ins->getCaptionHTML(ods, runparams); + if (!def.empty()) + ods << def << '\n'; + return ods.str(); +} + + InsetLayout::InsetDecoration InsetCollapsable::decoration() const { if (!layout_) diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index a6213296ba..730e4c6e37 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -183,6 +183,10 @@ protected: /// InsetCaption const * getCaptionInset() const; /// + docstring getCaptionText(OutputParams const &) const; + /// + docstring getCaptionHTML(OutputParams const &) const; + /// mutable CollapseStatus status_; private: /// cache for the layout_. Make sure it is in sync with the document class! diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 4cec685bd0..194e4f769a 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -486,38 +486,6 @@ docstring InsetFloat::getCaption(OutputParams const & runparams) const } -docstring InsetFloat::getCaptionText(OutputParams const & runparams) const -{ - if (paragraphs().empty()) - return docstring(); - - InsetCaption const * ins = getCaptionInset(); - if (ins == 0) - return docstring(); - - odocstringstream ods; - ins->getCaptionText(ods, runparams); - return ods.str(); -} - - -docstring InsetFloat::getCaptionHTML(OutputParams const & runparams) const -{ - if (paragraphs().empty()) - return docstring(); - - InsetCaption const * ins = getCaptionInset(); - if (ins == 0) - return docstring(); - - odocstringstream ods; - docstring def = ins->getCaptionHTML(ods, runparams); - if (!def.empty()) - ods << def << '\n'; - return ods.str(); -} - - void InsetFloat::string2params(string const & in, InsetFloatParams & params) { params = InsetFloatParams(); diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 31ed027084..a5ea2ef64f 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -111,10 +111,6 @@ private: /// docstring getCaption(OutputParams const &) const; /// - docstring getCaptionText(OutputParams const &) const; - /// - docstring getCaptionHTML(OutputParams const &) const; - /// InsetFloatParams params_; /// docstring name_; -- 2.39.2