]> git.lyx.org Git - features.git/commitdiff
Fix up MathML output of integrals.
authorRichard Heck <rgheck@comcast.net>
Thu, 17 Dec 2009 16:06:00 +0000 (16:06 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 17 Dec 2009 16:06:00 +0000 (16:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32567 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathExInt.cpp
src/mathed/InsetMathExInt.h

index bc26c05f530ba1823a9189bc9de6aee9421e87dc..be175287e38fcb4c993bd5fdaefd1c756b8d7ab4 100644 (file)
@@ -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") << "&sum;" << 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) << "<mo> &InvisibleTimes; </mo>"
           << MTag("mrow") << "<mo> &DifferentialD; </mo>"
           << cell(1) << ETag("mrow");
index d640b026227a446da1d6f83b6437fc6b06b31cc6..ced825b89074d668e31e1015a2f7baa49f140140 100644 (file)
 
 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 = ..."