]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.cpp
typo
[lyx.git] / src / mathed / InsetMathGrid.cpp
index 7158df2e432594d2a667aced0893120053cdc511..90f53fd54c229f2f4118d67c14de8ff78947b1ab 100644 (file)
@@ -78,41 +78,15 @@ static void resetGrid(InsetMathGrid & grid)
 }
 
 
-
-//////////////////////////////////////////////////////////////
-
-
-InsetMathGrid::CellInfo::CellInfo()
-       : multi(CELL_NORMAL)
-{}
-
-
-
 //////////////////////////////////////////////////////////////
 
 
-InsetMathGrid::RowInfo::RowInfo()
-       : descent(0), ascent(0), lines(0), skip(0),
-         allow_newpage(true)
-{}
-
-
-
 int InsetMathGrid::RowInfo::skipPixels(MetricsInfo const & mi) const
 {
        return mi.base.inPixels(crskip);
 }
 
 
-
-//////////////////////////////////////////////////////////////
-
-
-InsetMathGrid::ColInfo::ColInfo()
-       : align('c'), width(0), offset(0), lines(0), skip(0)
-{}
-
-
 //////////////////////////////////////////////////////////////
 
 
@@ -1184,7 +1158,7 @@ void InsetMathGrid::normalize(NormalStream & os) const
 }
 
 
-void InsetMathGrid::mathmlize(MathStream & ms) const
+void InsetMathGrid::mathmlize(MathMLStream & ms) const
 {
        bool const havetable = nrows() > 1 || ncols() > 1;
        if (havetable)
@@ -1263,14 +1237,14 @@ void InsetMathGrid::validate(LaTeXFeatures & features) const
 }
 
 
-void InsetMathGrid::write(WriteStream & os) const
+void InsetMathGrid::write(TeXMathStream & os) const
 {
        write(os, 0, 0, nrows(), ncols());
 }
 
-void InsetMathGrid::write(WriteStream & os,
-                         row_type beg_row, col_type beg_col,
-                         row_type end_row, col_type end_col) const
+void InsetMathGrid::write(TeXMathStream & os,
+                          row_type beg_row, col_type beg_col,
+                          row_type end_row, col_type end_col) const
 {
        MathEnsurer ensurer(os, false);
        docstring eol;
@@ -1284,7 +1258,7 @@ void InsetMathGrid::write(WriteStream & os,
                for (col_type col = beg_col; col < end_col; ++col) {
                        idx_type const idx = index(row, col);
                        bool const empty_cell = cell(idx).empty();
-                       if (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL)
+                       if (last_eoln && (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL))
                                last_eoln = false;
                        if (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL ||
                            colinfo_[col + 1].lines) {
@@ -1295,7 +1269,7 @@ void InsetMathGrid::write(WriteStream & os,
                for (col_type col = beg_col; col < end_col;) {
                        int nccols = 1;
                        idx_type const idx = index(row, col);
-                       TexRow::RowEntry entry = TexRow::mathEntry(id(),idx);
+                       TexRow::RowEntry const entry = TexRow::mathEntry(id(),idx);
                        os.texrow().start(entry);
                        if (col >= lastcol) {
                                ++col;
@@ -1592,7 +1566,8 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                        idocstringstream is(cmd.argument());
                        int n = 0;
                        is >> n;
-                       topaste = cap::selection(n, buffer().params().documentClassPtr());
+                       topaste = cap::selection(n, make_pair(buffer().params().documentClassPtr(),
+                                                             buffer().params().authors()), true);
                }
                InsetMathGrid grid(buffer_, 1, 1);
                if (!topaste.empty())