]> git.lyx.org Git - features.git/commitdiff
* src/insets/insetbase.[Ch]: make plaintext() abstract to force subclasses to
authorMichael Schmitt <michael.schmitt@teststep.org>
Fri, 16 Feb 2007 10:05:30 +0000 (10:05 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Fri, 16 Feb 2007 10:05:30 +0000 (10:05 +0000)
implement it by themselves
* src/insets/insetenv.[Ch]: fix plaintext()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17220 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetbase.C
src/insets/insetbase.h
src/insets/insetenv.C
src/insets/insetenv.h

index 29d5448f96ffbc88e8ea3e83aa342e2528f643d4..a5f22bf3e64741b202a25480152df0e2f3420b07 100644 (file)
@@ -212,13 +212,6 @@ bool InsetBase::idxUpDown(LCursor &, bool) const
 }
 
 
-int InsetBase::plaintext(Buffer const &,
-       odocstream &, OutputParams const &) const
-{
-       return 0;
-}
-
-
 int InsetBase::docbook(Buffer const &,
        odocstream &, OutputParams const &) const
 {
index c05df372d92fbe1f901a8578dc25d0bc2791bf8e..ae6ac1cf9b8b8c5a874b3abc28a649ab91283b44 100644 (file)
@@ -204,10 +204,10 @@ public:
        /// return the number of characters, in case of multiple lines of
        /// output, add runparams.linelen to the number of chars in the last line
        virtual int plaintext(Buffer const &, odocstream &,
-               OutputParams const &) const;
+                             OutputParams const &) const = 0;
        /// docbook output
        virtual int docbook(Buffer const &, odocstream & os,
-               OutputParams const &) const;
+                           OutputParams const &) const;
        /// the string that is passed to the TOC
        virtual void textString(Buffer const &, odocstream &) const {}
 
index fd2d2cca4fecf2f374c78977f9afed1094a5f72c..c97f85c320dba2239257ffcc908644429d26c8fc 100644 (file)
@@ -15,6 +15,7 @@
 #include "bufferparams.h"
 #include "gettext.h"
 #include "paragraph.h"
+#include "outputparams.h"
 #include "output_latex.h"
 #include "texrow.h"
 
@@ -67,7 +68,7 @@ docstring const InsetEnvironment::editMessage() const
 
 
 int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
-                           OutputParams const & runparams) const
+                            OutputParams const & runparams) const
 {
        // FIXME UNICODE
        os << from_utf8(layout_->latexheader);
@@ -80,6 +81,17 @@ int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
 }
 
 
+int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
+                                OutputParams const & runparams) const
+{
+       os << '[' << to_utf8(getInsetName()) << ":\n";
+       InsetText::plaintext(buf, os, runparams);
+       os << "\n]";
+
+       return 1 + runparams.linelen; // one char on a separate line
+}
+
+
 LyXLayout_ptr const & InsetEnvironment::layout() const
 {
        return layout_;
index 0925a20ad39a05d4dc42f4d146fbb15211fe2c4c..7104f3cb9d3f3c12c530de99a8bc4ab4d17f487c 100644 (file)
@@ -30,7 +30,10 @@ public:
        InsetBase::Code lyxCode() const { return InsetBase::ENVIRONMENT_CODE; }
        ///
        int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+                 OutputParams const &) const;
+       ///
+       int plaintext(Buffer const &, odocstream &,
+                     OutputParams const &) const;
        ///
        virtual docstring const editMessage() const;
        ///