}
-docstring InsetCaption::xhtml(odocstream & os,
- OutputParams const & runparams) const
+docstring InsetCaption::xhtml(odocstream &,
+ OutputParams const &) const
{
return docstring();
}
}
-int InsetCaption::getCaptionText(odocstream & os,
+int InsetCaption::getCaptionAsPlaintext(odocstream & os,
OutputParams const & runparams) const
{
os << full_label_ << ' ';
}
-docstring InsetCaption::getCaptionHTML(odocstream & os,
+docstring InsetCaption::getCaptionAsHTML(odocstream & os,
OutputParams const & runparams) const
{
os << full_label_ << ' ';
/// return the optional argument(s) only
int getOptArg(odocstream & os, OutputParams const &) const;
/// return the caption text
- int getCaptionText(odocstream & os, OutputParams const &) const;
+ int getCaptionAsPlaintext(odocstream & os, OutputParams const &) const;
/// return the caption text as HTML
- docstring getCaptionHTML(odocstream & os, OutputParams const &) const;
+ docstring getCaptionAsHTML(odocstream & os, OutputParams const &) const;
private:
///
void write(std::ostream & os) const;
#include "FloatList.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "InsetCaption.h"
#include "InsetLayout.h"
#include "InsetList.h"
#include "Language.h"
}
-InsetCaption const * InsetCollapsable::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<InsetCaption const *>(it->inset);
- return ins;
- }
- }
- }
- return 0;
-}
-
-
-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_)
namespace lyx {
class CursorSlice;
-class InsetCaption;
class InsetLayout;
namespace frontend { class Painter; }
///
virtual void resetParagraphsFont();
///
- 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!
#include "ErrorList.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
+#include "InsetCaption.h"
#include "InsetList.h"
#include "Intl.h"
#include "Lexer.h"
}
+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<InsetCaption const *>(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;
+ docstring def = ins->getCaptionAsHTML(ods, runparams);
+ if (!def.empty())
+ ods << def << '\n';
+ return ods.str();
+}
+
+
} // namespace lyx
class CursorSlice;
class Dimension;
class ParagraphList;
+class InsetCaption;
class InsetTabular;
/**
virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
+protected:
+ ///
+ InsetCaption const * getCaptionInset() const;
+ ///
+ docstring getCaptionText(OutputParams const &) const;
+ ///
+ docstring getCaptionHTML(OutputParams const &) const;
private:
///
void initParagraphs(UsePlain type);
}
-docstring InsetWrap::getCaptionText(OutputParams const & runparams) const
-{
- if (paragraphs().empty())
- return docstring();
-
- 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) {
- odocstringstream ods;
- InsetCaption * ins =
- static_cast<InsetCaption *>(it->inset);
- ins->getCaptionText(ods, runparams);
- return ods.str();
- }
- }
- }
- return docstring();
-}
-
-
void InsetWrap::string2params(string const & in, InsetWrapParams & params)
{
params = InsetWrapParams();
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
- docstring getCaptionText(OutputParams const &) const;
- ///
docstring name() const;
///
Inset * clone() const { return new InsetWrap(*this); }