]> git.lyx.org Git - lyx.git/commitdiff
Micro optimization and constness
authorRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 5 Jan 2021 18:31:45 +0000 (13:31 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 5 Jan 2021 22:45:50 +0000 (17:45 -0500)
src/mathed/InsetMathGrid.cpp

index c01c74ac3e76476825ea85deae5b9f88f0a99ba6..4dbd8a1bdc387d7ce5bd1ee8608ea63e1435b752 100644 (file)
@@ -1258,7 +1258,7 @@ void InsetMathGrid::write(TeXMathStream & 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) {
@@ -1269,7 +1269,7 @@ void InsetMathGrid::write(TeXMathStream & 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;