]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetexternal.C
* BufferParams:
[lyx.git] / src / insets / insetexternal.C
index 0882c84fe4f218cdae2bc91b7b3438738eb602fa..3c6961dff817110d1e16aa87c6196787e14d37bf 100644 (file)
@@ -674,7 +674,7 @@ void InsetExternal::read(Buffer const & buffer, LyXLex & lex)
 
 
 int InsetExternal::latex(Buffer const & buf, odocstream & os,
-                        OutputParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        if (params_.draft) {
                // FIXME UNICODE
@@ -687,7 +687,7 @@ int InsetExternal::latex(Buffer const & buf, odocstream & os,
        // "nice" means that the buffer is exported to LaTeX format but not
        // run through the LaTeX compiler.
        // If we're running through the LaTeX compiler, we should write the
-       // generated files in the bufer's temporary directory.
+       // generated files in the buffer's temporary directory.
        bool const external_in_tmpdir = !runparams.nice;
        bool const dryrun = runparams.dryrun || runparams.inComment;
 
@@ -710,9 +710,8 @@ int InsetExternal::latex(Buffer const & buf, odocstream & os,
                                                        external_in_tmpdir,
                                                        dryrun);
                 }
-                
        }
-        
+
        return external::writeExternal(params_, "LaTeX", buf, os,
                                        *(runparams.exportdata),
                                        external_in_tmpdir,
@@ -721,16 +720,18 @@ int InsetExternal::latex(Buffer const & buf, odocstream & os,
 
 
 int InsetExternal::plaintext(Buffer const & buf, odocstream & os,
-                        OutputParams const & runparams) const
+                             OutputParams const & runparams) const
 {
-       return external::writeExternal(params_, "Ascii", buf, os,
-                                      *(runparams.exportdata), false,
-                                      runparams.dryrun || runparams.inComment);
+       os << '\n'; // output external material on a new line
+       external::writeExternal(params_, "Ascii", buf, os,
+                               *(runparams.exportdata), false,
+                               runparams.dryrun || runparams.inComment);
+       return PLAINTEXT_NEWLINE;
 }
 
 
 int InsetExternal::docbook(Buffer const & buf, odocstream & os,
-                          OutputParams const & runparams) const
+                           OutputParams const & runparams) const
 {
        return external::writeExternal(params_, "DocBook", buf, os,
                                       *(runparams.exportdata), false,
@@ -802,7 +803,7 @@ bool preview_wanted(InsetExternalParams const & params)
 docstring const latex_string(InsetExternal const & inset, Buffer const & buffer)
 {
        odocstringstream os;
-       OutputParams runparams;
+       OutputParams runparams(0);
        runparams.flavor = OutputParams::LATEX;
        inset.latex(buffer, os, runparams);
        return os.str();