From 14001c49fe0fb3d95a0f69f63344e7ae59d28180 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 31 Dec 2009 21:00:49 +0000 Subject: [PATCH] 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 --- src/mathed/InsetMathGrid.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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"); -- 2.39.2