]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBig.cpp
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / InsetMathBig.cpp
index eeaf96514bd97fdd32d6c9d79585f9fc4e294785..aeb1ee5f8c1bd2013bf2b00a5272a267b3fafda8 100644 (file)
@@ -39,6 +39,25 @@ docstring InsetMathBig::name() const
 }
 
 
+MathClass InsetMathBig::mathClass() const
+{
+       /* The class of the delimiter depends on the type (l, m, r, nothing).
+        * For example, the definition of \bigl in LaTeX sources is
+        * \def\bigl{\mathopen\big}
+        */
+       switch(name_.back()) {
+       case 'l':
+               return MC_OPEN;
+       case 'm':
+               return MC_REL;
+       case 'r':
+               return MC_CLOSE;
+       default:
+               return MC_ORD;
+       }
+}
+
+
 Inset * InsetMathBig::clone() const
 {
        return new InsetMathBig(*this);
@@ -49,9 +68,9 @@ InsetMathBig::size_type InsetMathBig::size() const
 {
        // order: big Big bigg Bigg biggg Biggg
        //        0   1   2    3    4     5
-       char_type const c = name_[name_.size() - 1];
+       char_type const c = name_.back();
        int const base_size = (c == 'l' || c == 'm' || c == 'r') ? 4 : 3;
-       return name_[0] == 'B' ?
+       return name_.front() == 'B' ?
                2 * (name_.size() - base_size) + 1:
                2 * (name_.size() - base_size);
 }
@@ -116,11 +135,12 @@ void InsetMathBig::normalize(NormalStream & os) const
 }
 
 
-void InsetMathBig::mathmlize(MathStream & os) const
+void InsetMathBig::mathmlize(MathStream & ms) const
 {
-       os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true'>"
-          << convertDelimToXMLEscape(delim_)
-          << "</mo>";
+       ms << "<" << from_ascii(ms.namespacedTag("mo"))
+          << " form='prefix' fence='true' stretchy='true' symmetric='true'>"
+          << convertDelimToXMLEscape(delim_, ms.xmlMode())
+          << "</" << from_ascii(ms.namespacedTag("mo")) << ">";
 }
 
 
@@ -134,7 +154,7 @@ void InsetMathBig::htmlize(HtmlStream & os) const
        default: name  = "big"; break;
        }
        os << MTag("span", "class='" + name + "symbol'")
-          << convertDelimToXMLEscape(delim_)
+          << convertDelimToXMLEscape(delim_, false)
           << ETag("span");
 }