From: Richard Heck Date: Thu, 31 Dec 2009 21:00:49 +0000 (+0000) Subject: Fix up the InsetMathGrid output: detect better if we have a table, and X-Git-Tag: 2.0.0~4639 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=14001c49fe0fb3d95a0f69f63344e7ae59d28180;p=features.git Fix up the InsetMathGrid output: detect better if we have a table, and use appropriate tags. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32714 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 432a39a2f2..2256a08f60 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -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");