The branch, 2.0.x, has been updated.

- Log -----------------------------------------------------------------

commit 1e8f537481acd03816cb8b1c44daf05de0b52b43
Author: Richard Heck <rgh...@lyx.org>
Date:   Wed Jul 11 11:35:12 2012 -0400

    Math output flavor was not set when viewing source code.
    
    Cherry-picked from e7877f6fee86012b84af15c25776fc22d639f36c.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 0b4679d..ec525f7 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3224,6 +3224,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 if (runparams.flavor == OutputParams::TEXT) {
                        bool dummy;
@@ -3605,20 +3606,7 @@ bool Buffer::doExport(string const & format, 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));
@@ -3758,6 +3746,26 @@ bool Buffer::doExport(string const & format, 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;
+       }
+}
+
+
+
 bool Buffer::preview(string const & format, bool includeall) const
 {
        MarkAsExporting exporting(this);
diff --git a/src/Buffer.h b/src/Buffer.h
index 8a2de9e..410cb97 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -676,6 +676,8 @@ public:
        int charCount(bool with_blanks) const;
 
 private:
+       ///
+       void setMathFlavor(OutputParams & op) const;
        /// Change name of buffer. Updates "read-only" flag.
        void setFileName(support::FileName const & fname);
        ///

-----------------------------------------------------------------------

Summary of changes:
 src/Buffer.cpp |   36 ++++++++++++++++++++++--------------
 src/Buffer.h   |    2 ++
 2 files changed, 24 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to