]> git.lyx.org Git - features.git/commitdiff
Fix MathML output of sums.
authorRichard Heck <rgheck@comcast.net>
Thu, 17 Dec 2009 15:54:49 +0000 (15:54 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 17 Dec 2009 15:54:49 +0000 (15:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32566 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathExInt.cpp

index 5313f0adc306b171f9a2d29c34b650b420fedc13..bc26c05f530ba1823a9189bc9de6aee9421e87dc 100644 (file)
@@ -124,11 +124,41 @@ void InsetMathExInt::mathematica(MathematicaStream & os) const
 
 void InsetMathExInt::mathmlize(MathStream & os) const
 {
+       if (symbol_ == "sum") {
+               bool const lower = !cell(1).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") << MTag("mo") << "&sum;" << ETag("mo") << ETag("mrow");
+               if (lower) {
+                       os << MTag("mrow");
+                       os << cell(1);
+                       if (!cell(2).empty())
+                               os << MTag("mo") << "=" << ETag("mo") 
+                                  << cell(2);
+                       os << 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);
+               return;
+       }
+       // some kind of integral
        InsetMathSymbol sym(symbol_);
        //if (hasScripts())
        //      mathmlize(sym, os);
        //else
-               sym.mathmlize(os);
+       sym.mathmlize(os);
        os << cell(0) << "<mo> &InvisibleTimes; </mo>"
           << MTag("mrow") << "<mo> &DifferentialD; </mo>"
           << cell(1) << ETag("mrow");