]> git.lyx.org Git - features.git/commitdiff
Re-organize logic of getSourceCode() routine, so we can see XHTML
authorRichard Heck <rgheck@lyx.org>
Sat, 28 Apr 2012 01:14:25 +0000 (21:14 -0400)
committerRichard Heck <rgheck@lyx.org>
Sat, 28 Apr 2012 01:14:25 +0000 (21:14 -0400)
for DocBook files.

src/Buffer.cpp

index 2c4e9a4788392b8e77413adddce0c76820768349..20ca153959542e191f0da6842a9e14937d3cadf0 100644 (file)
@@ -3306,9 +3306,7 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                texrow.newline();
                texrow.newline();
                // output paragraphs
-               if (params().isDocBook())
-                       docbookParagraphs(text(), *this, os, runparams);
-               else if (runparams.flavor == OutputParams::HTML) {
+               if (runparams.flavor == OutputParams::HTML) {
                        XHTMLStream xs(os);
                        setMathFlavor(runparams);
                        xhtmlParagraphs(text(), *this, xs, runparams);
@@ -3318,6 +3316,8 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                        // Probably should have some routine with a signature like them.
                        writePlaintextParagraph(*this,
                                text().paragraphs()[par_begin], os, runparams, dummy);
+               } else if (params().isDocBook()) {
+                       docbookParagraphs(text(), *this, os, runparams);
                } else {
                        // latex or literate
                        otexstream ots(os, texrow);
@@ -3335,11 +3335,11 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                d->texrow.reset();
                d->texrow.newline();
                d->texrow.newline();
-               if (params().isDocBook())
-                       writeDocBookSource(os, absFileName(), runparams, output);
-               else if (runparams.flavor == OutputParams::HTML)
+               if (runparams.flavor == OutputParams::HTML) {
                        writeLyXHTMLSource(os, runparams, output);
-               else {
+               } else if (params().isDocBook()) {
+                               writeDocBookSource(os, absFileName(), runparams, output);
+               } else {
                        // latex or literate
                        otexstream ots(os, d->texrow);
                        writeLaTeXSource(ots, string(), runparams, output);