]> git.lyx.org Git - features.git/commitdiff
* src/insets/insetbranch.[Ch]:
authorMichael Schmitt <michael.schmitt@teststep.org>
Fri, 16 Feb 2007 09:28:25 +0000 (09:28 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Fri, 16 Feb 2007 09:28:25 +0000 (09:28 +0000)
* src/insets/inseturl.[Ch]:
* src/insets/insetfoot.[Ch]: fix plaintext() & WS changes

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

src/insets/insetbranch.C
src/insets/insetbranch.h
src/insets/insetfoot.C
src/insets/insetfoot.h
src/insets/inseturl.C
src/insets/inseturl.h

index d39d69c718adfa5716e679c9fdecbfba235e1e53..0f39abdcf34dfdca62f7b33055a5254f49ecb37b 100644 (file)
@@ -23,6 +23,7 @@
 #include "LColor.h"
 #include "lyxlex.h"
 #include "paragraph.h"
+#include "outputparams.h"
 
 #include <sstream>
 
@@ -222,26 +223,32 @@ bool InsetBranch::isBranchSelected(Buffer const & buffer) const
 
 
 int InsetBranch::latex(Buffer const & buf, odocstream & os,
-                      OutputParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        return isBranchSelected(buf) ?
                InsetText::latex(buf, os, runparams) : 0;
 }
 
 
-int InsetBranch::docbook(Buffer const & buf, odocstream & os,
-                        OutputParams const & runparams) const
+int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
+                           OutputParams const & runparams) const
 {
-       return isBranchSelected(buf) ?
-               InsetText::docbook(buf, os, runparams) : 0;
+       if (!isBranchSelected(buf))
+               return 0;
+
+       os << '[' << _("branch") << ' ' << params_.branch << ":\n";
+       InsetText::plaintext(buf, os, runparams);
+       os << "\n]";
+
+       return 1 + runparams.linelen; // one char on a separate line
 }
 
 
-int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
-                          OutputParams const & runparams) const
+int InsetBranch::docbook(Buffer const & buf, odocstream & os,
+                         OutputParams const & runparams) const
 {
        return isBranchSelected(buf) ?
-               InsetText::plaintext(buf, os, runparams): 0;
+               InsetText::docbook(buf, os, runparams) : 0;
 }
 
 
index f39fe12707c25f5bcca7a09847972ae5fd1a7bc8..a680772452f89d688edf0b9b343ec5424b79032a 100644 (file)
@@ -55,13 +55,14 @@ public:
        ///
        bool showInsetDialog(BufferView *) const;
        ///
-       int latex(Buffer const &, odocstream &, OutputParams const &) const;
-       ///
-       int docbook(Buffer const &, odocstream &,
-                   OutputParams const & runparams) const;
+       int latex(Buffer const &, odocstream &,
+                 OutputParams const &) const;
        ///
        int plaintext(Buffer const &, odocstream &,
-                 OutputParams const & runparams) const;
+                     OutputParams const &) const;
+       ///
+       int docbook(Buffer const &, odocstream &,
+                   OutputParams const &) const;
        ///
        void textString(Buffer const & buf, odocstream &) const;
        ///
index 2a1536973b3d1dcf8e2362c6712a989d943df90f..f2d7c3c7650cfed1650e40df1dbf97f3e465d5b5 100644 (file)
@@ -60,7 +60,7 @@ docstring const InsetFoot::editMessage() const
 
 
 int InsetFoot::latex(Buffer const & buf, odocstream & os,
-                    OutputParams const & runparams_in) const
+                     OutputParams const & runparams_in) const
 {
        OutputParams runparams = runparams_in;
        // footnotes in titling commands like \title have moving arguments
@@ -81,7 +81,7 @@ int InsetFoot::latex(Buffer const & buf, odocstream & os,
 
 
 int InsetFoot::plaintext(Buffer const & buf, odocstream & os,
-                          OutputParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        os << '[' << _("footnote") << ":\n";
        InsetText::plaintext(buf, os, runparams);
@@ -92,7 +92,7 @@ int InsetFoot::plaintext(Buffer const & buf, odocstream & os,
 
 
 int InsetFoot::docbook(Buffer const & buf, odocstream & os,
-                      OutputParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        os << "<footnote>";
        int const i = InsetText::docbook(buf, os, runparams);
index 6918b2830cea678d6ba4fe4a5c9c47eac8cf75cf..b74ea35fb08ace47ae25f1627d06a8ade5f502ab 100644 (file)
@@ -29,13 +29,13 @@ public:
        InsetBase::Code lyxCode() const { return InsetBase::FOOT_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;
 protected:
index 4bd7f5765a8d581e512c828af431d7aafdd426ab..ff3e4229dda3d7337dc341095ca4f0a171b4b6c6 100644 (file)
@@ -58,7 +58,7 @@ docstring const InsetUrl::getScreenLabel(Buffer const &) const
 
 
 int InsetUrl::latex(Buffer const &, odocstream & os,
-                   OutputParams const & runparams) const
+                    OutputParams const & runparams) const
 {
        docstring const & name = getParam("name");
        if (!name.empty())
@@ -71,19 +71,24 @@ int InsetUrl::latex(Buffer const &, odocstream & os,
 
 
 int InsetUrl::plaintext(Buffer const &, odocstream & os,
-                   OutputParams const &) const
+                        OutputParams const &) const
 {
-       os << '[' << getParam("target");
+       odocstringstream oss;
+
+       oss << '[' << getParam("target");
        if (getParam("name").empty())
-               os << ']';
+               oss << ']';
        else
-               os << "||" << getParam("name") << ']';
-       return 0;
+               oss << "||" << getParam("name") << ']';
+
+       docstring str = oss.str();
+       os << str;
+       return str.size();
 }
 
 
 int InsetUrl::docbook(Buffer const &, odocstream & os,
-                     OutputParams const &) const
+                      OutputParams const &) const
 {
        os << "<ulink url=\"" 
           << subst(getParam("target"), from_ascii("&"), from_ascii("&amp;"))
index 124600e091507125c60eaf27c6a2e02cf538002d..42093064599c0c608a1a0f8bd6fd44f1944136f4 100644 (file)
@@ -39,13 +39,13 @@ public:
        bool display() const { return false; }
        ///
        int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+                 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;
        /// the string that is passed to the TOC
        virtual int textString(Buffer const &, odocstream &,
                OutputParams const &) const;