X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathMatrix.cpp;h=620f20f961fdfcbec4f41c0721d116b7bd137ea9;hb=ecbd047cffa1c4af95cf4ab91a7d2fded4a5584c;hp=4d309d13e88dba668401e28dd6b23e4562f17149;hpb=edff97cb3004d55d12260331bab88d1ef14fc946;p=lyx.git diff --git a/src/mathed/InsetMathMatrix.cpp b/src/mathed/InsetMathMatrix.cpp index 4d309d13e8..620f20f961 100644 --- a/src/mathed/InsetMathMatrix.cpp +++ b/src/mathed/InsetMathMatrix.cpp @@ -95,17 +95,27 @@ void InsetMathMatrix::mathematica(MathematicaStream & os) const void InsetMathMatrix::mathmlize(MathStream & os) const { os << "" - << left_ << ""; - os << MTag("mtable"); + << convertDelimToXMLEscape(left_) + << "" + << MTag("mtable"); for (row_type row = 0; row < nrows(); ++row) { os << MTag("mtr"); - for (col_type col = 0; col < ncols(); ++col) - os << MTag("mtd") << cell(index(row, col)) << ETag("mtd"); + for (col_type col = 0; col < ncols(); ++col) { + idx_type const i = index(row, col); + if (cellinfo_[i].multi_ != CELL_PART_OF_MULTICOLUMN) { + col_type const cellcols = ncellcols(i); + ostringstream attr; + if (cellcols > 1) + attr << "columnspan='" << cellcols << '\''; + os << MTag("mtd", attr.str()) << cell(i) << ETag("mtd"); + } + } os << ETag("mtr"); } os << ETag("mtable"); os << "" - << right_ << ""; + << convertDelimToXMLEscape(right_) + << ""; } @@ -124,8 +134,18 @@ void InsetMathMatrix::htmlize(HtmlStream & os) const os << MTag("tr") << '\n'; if (row == 0) os << MTag("td", lattrib) << ETag("td") << '\n'; - for (col_type col = 0; col < ncols(); ++col) - os << MTag("td") << cell(index(row, col)) << ETag("td") << '\n'; + for (col_type col = 0; col < ncols(); ++col) { + idx_type const i = index(row, col); + if (cellinfo_[i].multi_ != CELL_PART_OF_MULTICOLUMN) { + col_type const cellcols = ncellcols(i); + ostringstream attr; + if (cellcols > 1) + attr << "colspan='" << cellcols + << '\''; + os << MTag("td", attr.str()) << cell(i) + << ETag("td") << '\n'; + } + } if (row == 0) os << MTag("td", rattrib) << ETag("td") << '\n'; os << ETag("tr") << '\n';