]> git.lyx.org Git - features.git/commitdiff
Backport fix for bug #8087: Include children in plaintext export.
authorRichard Heck <rgheck@lyx.org>
Mon, 19 Mar 2012 21:33:47 +0000 (17:33 -0400)
committerRichard Heck <rgheck@lyx.org>
Thu, 10 May 2012 20:10:22 +0000 (16:10 -0400)
(cherry picked from commit 98a810c9d8b8d6bc0086779b7fa2d5be434bdbe2)

Forgot the return value.
(cherry picked from commit 0459c43769e507a68f2ec6e053350d4a77d19534)

src/insets/InsetInclude.cpp

index 568449790c3893e089dbc360a0fd7d27b8327c40..2940124d9747dfa1597603994aaadef7871b7a2a 100644 (file)
@@ -34,6 +34,7 @@
 #include "LyXRC.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
+#include "output_plaintext.h"
 #include "output_xhtml.h"
 #include "OutputParams.h"
 #include "TextClass.h"
@@ -796,7 +797,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 }
 
 
-int InsetInclude::plaintext(odocstream & os, OutputParams const &) const
+int InsetInclude::plaintext(odocstream & os, OutputParams const & op) const
 {
        if (isVerbatim(params()) || isListings(params())) {
                os << '[' << screenLabel() << '\n';
@@ -804,11 +805,16 @@ int InsetInclude::plaintext(odocstream & os, OutputParams const &) const
                os << includedFileName(buffer(), params()).fileContents("UTF-8");
                os << "\n]";
                return PLAINTEXT_NEWLINE + 1; // one char on a separate line
-       } else {
+       }
+
+       Buffer const * const ibuf = loadIfNeeded();
+       if (!ibuf) {
                docstring const str = '[' + screenLabel() + ']';
                os << str;
                return str.size();
        }
+       writePlaintextFile(*ibuf, os, op);
+       return 0;
 }