]> git.lyx.org Git - features.git/commitdiff
Fix up the InsetMathGrid output: detect better if we have a table, and
authorRichard Heck <rgheck@comcast.net>
Thu, 31 Dec 2009 21:00:49 +0000 (21:00 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 31 Dec 2009 21:00:49 +0000 (21:00 +0000)
use appropriate tags.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32714 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathGrid.cpp

index 432a39a2f26b0be7d58f1a5805d2cea7864c291e..2256a08f609bbe6dc7328fec06eacf7834860efe 100644 (file)
@@ -969,14 +969,20 @@ void InsetMathGrid::normalize(NormalStream & os) const
 
 void InsetMathGrid::mathmlize(MathStream & os) const
 {
-       bool const havetable = nrows() > 1;
+       bool const havetable = nrows() > 1 || ncols() > 1;
        if (havetable)
                os << MTag("mtable");
+       char const * const celltag = havetable ? "mtd" : "mrow";
        for (row_type row = 0; row < nrows(); ++row) {
-               os << MTag("mrow");
-               for (col_type col = 0; col < ncols(); ++col)
+               if (havetable)
+                       os << MTag("mtr");;
+               for (col_type col = 0; col < ncols(); ++col) {
+                       os << MTag(celltag);
                        os << cell(index(row, col));
-               os << ETag("mrow");
+                       os << ETag(celltag);
+               }
+               if (havetable)
+                       os << ETag("mtr");;
        }
        if (havetable)
                os << ETag("mtable");