From: Richard Heck Date: Wed, 21 Jul 2010 14:02:46 +0000 (+0000) Subject: Prepare for the use of exceptions to catch occasions when we can't X-Git-Tag: 2.0.0~2916 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9803d7a2a670777ef49df3b9cb3db9c4034fe5d9;p=features.git Prepare for the use of exceptions to catch occasions when we can't export as MathML, etc. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34996 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index dd052912bf..bd3d6d5d9f 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1848,23 +1848,29 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const // FIXME Eventually we would like to do this inset by inset. switch (mathtype) { case BufferParams::MathML: { + odocstringstream os; + MathStream ms(os); + InsetMathGrid::mathmlize(ms); if (getType() == hullSimple) xs << html::StartTag("math", "xmlns=\"http://www.w3.org/1998/Math/MathML\"", true); else xs << html::StartTag("math", "display=\"block\" xmlns=\"http://www.w3.org/1998/Math/MathML\"", true); - MathStream ms(xs.os()); - InsetMathGrid::mathmlize(ms); - xs << html::EndTag("math"); + xs << XHTMLStream::NextRaw() + << os.str() + << html::EndTag("math"); break; } case BufferParams::HTML: { - string const tag = (getType() == hullSimple) ? "span" : "div"; - xs << html::StartTag(tag, "class='formula'", true); - HtmlStream ms(xs.os()); + odocstringstream os; + HtmlStream ms(os); InsetMathGrid::htmlize(ms); - xs << html::EndTag(tag); + string const tag = (getType() == hullSimple) ? "span" : "div"; + xs << html::StartTag(tag, "class='formula'", true) + << XHTMLStream::NextRaw() + << os.str() + << html::EndTag(tag); break; } case BufferParams::Images: { @@ -1874,9 +1880,9 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const // FIXME Do we always have png? string const tag = (getType() == hullSimple) ? "span" : "div"; FileName const & mathimg = pimage->filename(); - xs << html::StartTag(tag); - xs << html::CompTag("img", "src=\"" + mathimg.onlyFileName() + "\""); - xs << html::EndTag(tag); + xs << html::StartTag(tag) + << html::CompTag("img", "src=\"" + mathimg.onlyFileName() + "\"") + << html::EndTag(tag); xs.cr(); // add the file to the list of files to be exported op.exportdata->addExternalFile("xhtml", mathimg); @@ -1891,7 +1897,9 @@ docstring InsetMathHull::xhtml(XHTMLStream & xs, OutputParams const & op) const // http://www.math.union.edu/~dpvc/jsMath/ // FIXME XHTML // probably should allow for some kind of customization here - xs << html::StartTag(tag, "class='math'") << latex << html::EndTag(tag); + xs << html::StartTag(tag, "class='math'") + << latex + << html::EndTag(tag); xs.cr(); } } // end switch