mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Math output flavor was not set when viewing source code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40406 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c2ff9de084
commit
e7877f6fee
@ -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));
|
||||
|
@ -645,6 +645,8 @@ private:
|
||||
bool includeall) const;
|
||||
///
|
||||
ExportStatus preview(std::string const & format, bool includeall = false) const;
|
||||
///
|
||||
void setMathFlavor(OutputParams & op) const;
|
||||
|
||||
public:
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user