]> git.lyx.org Git - features.git/commitdiff
Move TexRow stuff near where it is used.
authorRichard Heck <rgheck@lyx.org>
Mon, 4 Jun 2012 22:30:37 +0000 (18:30 -0400)
committerRichard Heck <rgheck@lyx.org>
Tue, 5 Jun 2012 14:24:15 +0000 (10:24 -0400)
src/Buffer.cpp

index 8fb72aecb1bd5475863309e635e41d0faadb8a6c..c0723bea0584cadb231b28c1ef8a9369b6fd71c4 100644 (file)
@@ -3316,10 +3316,6 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                                        convert<docstring>(par_end - 1))
                           << "\n\n";
                }
-               TexRow texrow;
-               texrow.reset();
-               texrow.newline();
-               texrow.newline();
                // output paragraphs
                if (runparams.flavor == OutputParams::HTML) {
                        XHTMLStream xs(os);
@@ -3334,6 +3330,10 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                } else if (params().isDocBook()) {
                        docbookParagraphs(text(), *this, os, runparams);
                } else {
+                       TexRow texrow;
+                       texrow.reset();
+                       texrow.newline();
+                       texrow.newline();
                        // latex or literate
                        otexstream ots(os, texrow);
                        latexParagraphs(*this, text(), ots, runparams);
@@ -3347,9 +3347,6 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                else if (output == OnlyBody)
                        os << _("Preview body");
                os << "\n\n";
-               d->texrow.reset();
-               d->texrow.newline();
-               d->texrow.newline();
                if (runparams.flavor == OutputParams::HTML) {
                        writeLyXHTMLSource(os, runparams, output);
                } else if (runparams.flavor == OutputParams::TEXT) {
@@ -3361,6 +3358,9 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                                writeDocBookSource(os, absFileName(), runparams, output);
                } else {
                        // latex or literate
+                       d->texrow.reset();
+                       d->texrow.newline();
+                       d->texrow.newline();
                        otexstream ots(os, d->texrow);
                        writeLaTeXSource(ots, string(), runparams, output);
                }