]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSubstack.cpp
Small improvement for bug #7509 as suggested by JMarc
[lyx.git] / src / mathed / InsetMathSubstack.cpp
index 2fb05748b225e52953a4c2f679c9e83f61e07a08..56d253e3b27e2b13e6c6ad25b8368babed0a2b4e 100644 (file)
@@ -78,8 +78,18 @@ bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
                        flag.setEnabled(false);
                        return true;
                }
+               // in contrary to \subaray, the columns in \substack
+               // are always centered and this cannot be changed
+               if (s == "align-left" || s == "align-right") {
+                       flag.message(bformat(
+                               from_utf8(N_("Can't change horizontal alignment in '%1$s'")),
+                               from_utf8(name)));
+                       flag.setEnabled(false);
+                       return true;
+               }
                break;
        }
+
        default:
                break;
        }
@@ -118,15 +128,31 @@ void InsetMathSubstack::maple(MapleStream & os) const
 }
 
 
+void InsetMathSubstack::mathmlize(MathStream & os) const
+{
+       int movers = 0;
+       row_type const numrows = nrows();
+       for (row_type row = 0; row < nrows(); ++row) {
+               if (row < numrows - 1) {
+                       movers ++;
+                       os << MTag("munder");
+               }
+               os << MTag("mrow") << cell(index(row, 0)) << ETag("mrow");
+       }
+       for (int i = 1; i <= movers; ++i)
+               os << ETag("munder");
+}
+
+
 void InsetMathSubstack::htmlize(HtmlStream & os) const
 {
        os << MTag("span", "class='substack'");
-       for (row_type row = 0; row < nrows(); ++row) 
+       for (row_type row = 0; row < nrows(); ++row)
                os << MTag("span") << cell(index(row, 0)) << ETag("span");
        os << ETag("span");
 }
 
-       
+
 void InsetMathSubstack::validate(LaTeXFeatures & features) const
 {
        if (features.runparams().isLaTeX())
@@ -136,7 +162,7 @@ void InsetMathSubstack::validate(LaTeXFeatures & features) const
                        "span.substack{display: inline-block; vertical-align: middle; text-align:center; font-size: 75%;}\n"
                        "span.substack span{display: block;}\n"
                        "</style>");
-       
+
        InsetMathGrid::validate(features);
 }