]> git.lyx.org Git - lyx.git/commitdiff
* insetref.C:
authorMichael Schmitt <michael.schmitt@teststep.org>
Thu, 15 Feb 2007 23:28:31 +0000 (23:28 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Thu, 15 Feb 2007 23:28:31 +0000 (23:28 +0000)
* insetcommand.[Ch]:
* insetpagebreak.[Ch]: fix plaintext(); some header cleanup

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

src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/insetpagebreak.C
src/insets/insetpagebreak.h
src/insets/insetref.C

index 6d5248844b923d5650941ffb563ea74feb0313ae..6a1213aa531e7923005ccab4cdb2c832a44812e9 100644 (file)
@@ -84,7 +84,7 @@ void InsetCommand::setParams(InsetCommandParams const & p)
 
 
 int InsetCommand::latex(Buffer const &, odocstream & os,
-                       OutputParams const &) const
+                        OutputParams const &) const
 {
        os << getCommand();
        return 0;
@@ -92,14 +92,14 @@ int InsetCommand::latex(Buffer const &, odocstream & os,
 
 
 int InsetCommand::plaintext(Buffer const &, odocstream &,
-                       OutputParams const &) const
+                            OutputParams const &) const
 {
        return 0;
 }
 
 
 int InsetCommand::docbook(Buffer const &, odocstream &,
-                         OutputParams const &) const
+                          OutputParams const &) const
 {
        return 0;
 }
index a2397dba654e02ac2d2895395e20f89506e32522..c8788c946f4853294c412bc2281da12656302293 100644 (file)
@@ -48,14 +48,11 @@ public:
        virtual void read(Buffer const &, LyXLex & lex)
                { p_.read(lex); }
        ///
-       virtual int latex(Buffer const &, odocstream &,
-                         OutputParams const &) const;
+       int latex(Buffer const &, odocstream &, OutputParams const &) const;
        ///
-       int plaintext(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+       int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
        ///
-       virtual int docbook(Buffer const &, odocstream &,
-                           OutputParams const & runparams) const;
+       int docbook(Buffer const &, odocstream &, OutputParams const & runparams) const;
        ///
        InsetBase::Code lyxCode() const { return InsetBase::NO_CODE; }
 
index 3be10572cf9c11741a68dae83aa3af3cff103325..a606cefc5cd0046da9230e92a42ffd6a498fbaef 100644 (file)
@@ -17,6 +17,7 @@
 #include "LColor.h"
 #include "lyxtext.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 #include "TextMetrics.h"
 
 #include "frontends/FontMetrics.h"
@@ -79,7 +80,7 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 
 
 int InsetPagebreak::latex(Buffer const &, odocstream & os,
-                         OutputParams const &) const
+                          OutputParams const &) const
 {
        os << from_ascii(getCmdName()) << "{}";
        return 0;
@@ -87,15 +88,15 @@ int InsetPagebreak::latex(Buffer const &, odocstream & os,
 
 
 int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
-                         OutputParams const &) const
+                              OutputParams const & runparams) const
 {
        os << '\n';
-       return 0;
+       return runparams.linelen; 
 }
 
 
 int InsetPagebreak::docbook(Buffer const &, odocstream & os,
-                           OutputParams const &) const
+                            OutputParams const &) const
 {
        os << '\n';
        return 0;
index 33f25aba9830c63ca83901c4254311d9de55eee6..758e6f229223e4030fddb44e1b70b17980118c2e 100644 (file)
@@ -29,14 +29,14 @@ public:
 
        void draw(PainterInfo & pi, int x, int y) const;
 
-       virtual int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+       int latex(Buffer const &, odocstream &,
+                 OutputParams const &) const;
 
        int plaintext(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+                     OutputParams const &) const;
 
        int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
+                   OutputParams const &) const;
 
        void read(Buffer const &, LyXLex & lex);
 
index 2d2ad0dda08503d6abff4c43a2126f4146a30d6c..dd7a79892b62c3bd1526a0da2d6f00818867733f 100644 (file)
@@ -84,7 +84,7 @@ docstring const InsetRef::getScreenLabel(Buffer const &) const
 
 
 int InsetRef::latex(Buffer const &, odocstream & os,
-                   OutputParams const &) const
+                    OutputParams const &) const
 {
        // Don't output p_["name"], this is only used in docbook
        InsetCommandParams p(getCmdName());
@@ -95,15 +95,16 @@ int InsetRef::latex(Buffer const &, odocstream & os,
 
 
 int InsetRef::plaintext(Buffer const &, odocstream & os,
-                   OutputParams const &) const
+                        OutputParams const &) const
 {
-       os << '[' << getParam("reference") << ']';
-       return 0;
+       docstring str = getParam("reference");
+       os << '[' << str << ']';
+       return 2 + str.size();
 }
 
 
 int InsetRef::docbook(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        docstring const & name = getParam("name");
        if (name.empty()) {