]> git.lyx.org Git - features.git/commitdiff
Math output flavor was not set when viewing source code.
authorRichard Heck <rgheck@comcast.net>
Tue, 6 Dec 2011 22:17:06 +0000 (22:17 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 6 Dec 2011 22:17:06 +0000 (22:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40406 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h

index 1744cf0e516da479d7f22a19de4b5841859be0af..90285ec78ab9aacce7e07768c0f39c8bac37fc74 100644 (file)
@@ -3258,6 +3258,7 @@ void Buffer::getSourceCode(odocstream & os, string const format,
                        docbookParagraphs(text(), *this, os, runparams);
                else if (runparams.flavor == OutputParams::HTML) {
                        XHTMLStream xs(os);
+                       setMathFlavor(runparams);
                        xhtmlParagraphs(text(), *this, xs, runparams);
                } else {
                        // latex or literate
@@ -3576,6 +3577,25 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
 }
 
 
+void Buffer::setMathFlavor(OutputParams & op) const
+{
+       switch (params().html_math_output) {
+       case BufferParams::MathML:
+               op.math_flavor = OutputParams::MathAsMathML;
+               break;
+       case BufferParams::HTML:
+               op.math_flavor = OutputParams::MathAsHTML;
+               break;
+       case BufferParams::Images:
+               op.math_flavor = OutputParams::MathAsImages;
+               break;
+       case BufferParams::LaTeX:
+               op.math_flavor = OutputParams::MathAsLaTeX;
+               break;
+       }
+}
+
+
 Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir,
        bool includeall, string & result_file) const
 {
@@ -3650,20 +3670,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
        // HTML backend
        else if (backend_format == "xhtml") {
                runparams.flavor = OutputParams::HTML;
-               switch (params().html_math_output) {
-               case BufferParams::MathML:
-                       runparams.math_flavor = OutputParams::MathAsMathML;
-                       break;
-               case BufferParams::HTML:
-                       runparams.math_flavor = OutputParams::MathAsHTML;
-                       break;
-               case BufferParams::Images:
-                       runparams.math_flavor = OutputParams::MathAsImages;
-                       break;
-               case BufferParams::LaTeX:
-                       runparams.math_flavor = OutputParams::MathAsLaTeX;
-                       break;
-               }
+               setMathFlavor(runparams);
                makeLyXHTMLFile(FileName(filename), runparams);
        } else if (backend_format == "lyx")
                writeFile(FileName(filename));
index f8bd784fcec1789fafbfb705accb09cc07c0fbc2..9a2d4844adb04b4f349460a32b5a406c7650a5dd 100644 (file)
@@ -645,6 +645,8 @@ private:
                bool includeall) const;
        ///
        ExportStatus preview(std::string const & format, bool includeall = false) const;
+       ///
+       void setMathFlavor(OutputParams & op) const;
 
 public:
        ///