From c2407338d062602baa355718fef2557c324ae64b Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Fri, 16 Feb 2007 08:15:16 +0000 Subject: [PATCH] * src/insets/insetfloat.[Ch]: * src/insets/insetwrap.[Ch]: * src/insets/insetmarginal.[Ch]: fix plaintext(); code formatting git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17215 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insetfloat.C | 15 +++++++++++++-- src/insets/insetfloat.h | 7 +++++-- src/insets/insetmarginal.C | 17 +++++++++++++++-- src/insets/insetmarginal.h | 7 +++++-- src/insets/insetwrap.C | 15 +++++++++++++-- src/insets/insetwrap.h | 7 +++++-- 6 files changed, 56 insertions(+), 12 deletions(-) diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 54e38514e0..694287ff20 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -280,7 +280,7 @@ docstring const InsetFloat::editMessage() const int InsetFloat::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { FloatList const & floats = buf.params().getLyXTextClass().floats(); string tmptype = (params_.wide ? params_.type + "*" : params_.type); @@ -328,8 +328,19 @@ int InsetFloat::latex(Buffer const & buf, odocstream & os, } +int InsetFloat::plaintext(Buffer const & buf, odocstream & os, + OutputParams const & runparams) const +{ + os << '[' << _("float") << ' ' << floatName(params_.type, buf.params()) << ":\n"; + InsetText::plaintext(buf, os, runparams); + os << "\n]"; + + return 1 + runparams.linelen; // one char on a separate line +} + + int InsetFloat::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { // FIXME UNICODE os << '<' << from_ascii(params_.type) << '>'; diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index f05bd4ee1e..34f633c38a 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -60,10 +60,13 @@ public: virtual bool wide() const { return false; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; + /// + int plaintext(Buffer const &, odocstream &, + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// virtual docstring const editMessage() const; /// diff --git a/src/insets/insetmarginal.C b/src/insets/insetmarginal.C index c8f418bcb0..0b7c2945d8 100644 --- a/src/insets/insetmarginal.C +++ b/src/insets/insetmarginal.C @@ -15,6 +15,7 @@ #include "gettext.h" #include "paragraph.h" +#include "outputparams.h" #include "support/std_ostream.h" @@ -55,7 +56,7 @@ docstring const InsetMarginal::editMessage() const int InsetMarginal::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "%\n\\marginpar{"; int const i = InsetText::latex(buf, os, runparams); @@ -63,8 +64,20 @@ int InsetMarginal::latex(Buffer const & buf, odocstream & os, return i + 2; } + +int InsetMarginal::plaintext(Buffer const & buf, odocstream & os, + OutputParams const & runparams) const +{ + os << '[' << _("margin") << ":\n"; + InsetText::plaintext(buf, os, runparams); + os << "\n]"; + + return 1 + runparams.linelen; // one char on a separate line +} + + int InsetMarginal::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << ""; int const i = InsetText::docbook(buf, os, runparams); diff --git a/src/insets/insetmarginal.h b/src/insets/insetmarginal.h index 5a50a637c3..e4331b9faa 100644 --- a/src/insets/insetmarginal.h +++ b/src/insets/insetmarginal.h @@ -30,10 +30,13 @@ public: InsetBase::Code lyxCode() const { return InsetBase::MARGIN_CODE; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; + /// + int plaintext(Buffer const &, odocstream &, + OutputParams const & runparams) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const & runparams) const; + OutputParams const & runparams) const; /// virtual docstring const editMessage() const; protected: diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index 37390e519e..942d393723 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -180,7 +180,7 @@ docstring const InsetWrap::editMessage() const int InsetWrap::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "\\begin{floating" << from_ascii(params_.type) << '}'; if (!params_.placement.empty()) @@ -192,8 +192,19 @@ int InsetWrap::latex(Buffer const & buf, odocstream & os, } +int InsetWrap::plaintext(Buffer const & buf, odocstream & os, + OutputParams const & runparams) const +{ + os << '[' << _("wrap") << ' ' << floatName(params_.type, buf.params()) << ":\n"; + InsetText::plaintext(buf, os, runparams); + os << "\n]"; + + return 1 + runparams.linelen; // one char on a separate line +} + + int InsetWrap::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { // FIXME UNICODE os << '<' << from_ascii(params_.type) << '>'; diff --git a/src/insets/insetwrap.h b/src/insets/insetwrap.h index bcf337d7a0..3a6f8b3b8d 100644 --- a/src/insets/insetwrap.h +++ b/src/insets/insetwrap.h @@ -54,10 +54,13 @@ public: InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; + /// + int plaintext(Buffer const &, odocstream &, + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// virtual docstring const editMessage() const; /// -- 2.39.5