]> git.lyx.org Git - lyx.git/commitdiff
Fix MathML for binominals.
authorRichard Heck <rgheck@comcast.net>
Thu, 31 Dec 2009 21:22:04 +0000 (21:22 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 31 Dec 2009 21:22:04 +0000 (21:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32717 a592a061-630c-0410-9148-cb99ea01b6c8

development/HTML/HTML.notes
src/mathed/InsetMathFrac.cpp

index 8d6420d12aa95947df5fa0a6c2a3814d358baf40..2db751d81d8cad3dd7ee83e1b67e928233c13022 100644 (file)
@@ -56,8 +56,6 @@ Math
        - Array
        - Box: There is a general issue here with text mode nesting. See the FIXME attached
                to the SetMode class.
-       - Binom (in Frac): None of these tags exist in MathML 2.0. We'll
-               just output a fraction with delimiters.
        - Lefteqn
        - Overset: Use <mover>.
        - Par?
index 11d24469db1c09b752105035e8a1951186a2fcbb..9a244eaa34594a69c7da531eae0882bf4767405c 100644 (file)
@@ -535,18 +535,30 @@ void InsetMathBinom::normalize(NormalStream & os) const
 
 void InsetMathBinom::mathmlize(MathStream & os) const
 {
+       char ldelim = ' ';
+       char rdelim = ' ';
        switch (kind_) {
        case BINOM:
-               os << MTag("mbinom") << cell(0) << cell(1) << ETag("mbinom");
-               break;
        case TBINOM:
-               os << MTag("mtbinom") << cell(0) << cell(1) << ETag("mtbinom");
-               break;
        case DBINOM:
-       default:
-               os << MTag("mdbinom") << cell(0) << cell(1) << ETag("mdbinom");
+       case CHOOSE:
+               ldelim = '(';
+               rdelim = ')';
+               break;
+       case BRACE:
+               ldelim = '{';
+               rdelim = '}';
+               break;
+       case BRACK:
+               ldelim = '[';
+               rdelim = ']';
                break;
        }
+       os << "<mo fence='true' stretchy='true' form='prefix'>" << ldelim << "</mo>"
+          << "<mfrac linethickness='0'>"
+          << cell(0) << cell(1)
+          << "</mfrac>"
+          << "<mo fence='true' stretchy='true' form='postfix'>" << rdelim << "</mo>";
 }