]> git.lyx.org Git - features.git/commitdiff
* src/insets/insetinclude.[Ch]: fix plaintext(); code formatting
authorMichael Schmitt <michael.schmitt@teststep.org>
Tue, 20 Feb 2007 19:14:55 +0000 (19:14 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Tue, 20 Feb 2007 19:14:55 +0000 (19:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17281 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetinclude.C
src/insets/insetinclude.h

index c4cfdc685be25cfa65fcfe2cf0e2129bc843328b..0eaf0d5437cf3ddd603c6889bf2f611888143406 100644 (file)
@@ -369,7 +369,7 @@ bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params)
 
 
 int InsetInclude::latex(Buffer const & buffer, odocstream & os,
-                       OutputParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        string incfile(to_utf8(params_["filename"]));
 
@@ -491,22 +491,26 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
 
 
 int InsetInclude::plaintext(Buffer const & buffer, odocstream & os,
-                       OutputParams const &) const
+                            OutputParams const &) const
 {
        if (isVerbatim(params_)) {
+               os << '[' << getScreenLabel(buffer) << '\n';
                // FIXME: We don't know the encoding of the file
-               docstring const str = from_utf8(
-                       getFileContents(includedFilename(buffer, params_)));
+               docstring const str =
+                    from_utf8(getFileContents(includedFilename(buffer, params_)));
                os << str;
-               // Return how many newlines we issued.
-               return int(lyx::count(str.begin(), str.end(), '\n'));
+               os << "\n]";
+               return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+       } else {
+               docstring str = '[' + getScreenLabel(buffer) + ']';
+               os << str;
+               return str.size();
        }
-       return 0;
 }
 
 
 int InsetInclude::docbook(Buffer const & buffer, odocstream & os,
-                         OutputParams const & runparams) const
+                          OutputParams const & runparams) const
 {
        string incfile = to_utf8(params_["filename"]);
 
index c42159e30ce4fdfd0297565ac483ea11d2638921..8267e1b6cd248ecdd914e5c4a187a01b0b92160b 100644 (file)
@@ -82,13 +82,13 @@ public:
        void read(Buffer const &, LyXLex &);
        ///
        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;
        ///
        void validate(LaTeXFeatures &) const;
        ///