From: Richard Heck Date: Thu, 17 Dec 2009 16:06:00 +0000 (+0000) Subject: Fix up MathML output of integrals. X-Git-Tag: 2.0.0~4781 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c3fc67ef5484b2ccd6ec5a8986624c8a5dcc05ad;p=features.git Fix up MathML output of integrals. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32567 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp index bc26c05f53..be175287e3 100644 --- a/src/mathed/InsetMathExInt.cpp +++ b/src/mathed/InsetMathExInt.cpp @@ -124,6 +124,7 @@ void InsetMathExInt::mathematica(MathematicaStream & os) const void InsetMathExInt::mathmlize(MathStream & os) const { + InsetMathSymbol sym(symbol_); if (symbol_ == "sum") { bool const lower = !cell(1).empty(); bool const upper = !cell(3).empty(); @@ -133,7 +134,9 @@ void InsetMathExInt::mathmlize(MathStream & os) const os << MTag("msub"); else if (upper) os << MTag("msup"); - os << MTag("mrow") << MTag("mo") << "∑" << ETag("mo") << ETag("mrow"); + os << MTag("mrow"); + sym.mathmlize(os); + os << ETag("mrow"); if (lower) { os << MTag("mrow"); os << cell(1); @@ -154,11 +157,27 @@ void InsetMathExInt::mathmlize(MathStream & os) const return; } // some kind of integral - InsetMathSymbol sym(symbol_); - //if (hasScripts()) - // mathmlize(sym, os); - //else + bool const lower = !cell(2).empty(); + bool const upper = !cell(3).empty(); + if (lower && upper) + os << MTag("msubsup"); + else if (lower) + os << MTag("msub"); + else if (upper) + os << MTag("msup"); + os << MTag("mrow"); sym.mathmlize(os); + os << ETag("mrow"); + if (lower) + os << MTag("mrow") << cell(2) << ETag("mrow"); + if (upper) + os << MTag("mrow") << cell(3) << ETag("mrow"); + if (lower && upper) + os << ETag("msubsup"); + else if (lower) + os << ETag("msub"); + else if (upper) + os << ETag("msup"); os << cell(0) << "" << MTag("mrow") << "" << cell(1) << ETag("mrow"); diff --git a/src/mathed/InsetMathExInt.h b/src/mathed/InsetMathExInt.h index d640b02622..ced825b890 100644 --- a/src/mathed/InsetMathExInt.h +++ b/src/mathed/InsetMathExInt.h @@ -21,7 +21,11 @@ namespace lyx { -// for integrals, cell(0) is stuff before the 'd', cell(1) the stuff after +// for integrals: +// cell(0) is stuff before the 'd' +// cell(1) is the stuff after the 'd' +// cell(2) is the lower bound +// cell(3) is the upper bound // for sums: // cell(0) is the main body // cell(1) is the index (e.g., i), if the lower bound is "i = ..."