]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.cpp
Simplification
[lyx.git] / src / mathed / InsetMathGrid.cpp
index ef6b2652135673c10a0ea4c7a6729e27997b3b46..3de72abcb194cd9dedb022fc108871d345a0977a 100644 (file)
@@ -1634,9 +1634,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                        for (row_type r = 0; r < numrows; ++r) {
                                for (col_type c = 0; c < numcols; ++c) {
                                        idx_type i = index(r + startrow, c + startcol);
-                                       pos_type ipos = cur.pos() > pos_type(cell(i).size())
-                                                       ? pos_type(cell(i).size())
-                                                       : cur.pos();
+                                       pos_type const ipos = min(cur.pos(), pos_type(cell(i).size()));
                                        cell(i).insert(ipos, grid.cell(grid.index(r, c)));
                                }
                                if (hline_enabled)