]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Circumvent odd stmary font metrics (part of #9990).
[lyx.git] / src / insets / InsetTabular.cpp
index be2e00fa376ec34fd1104956c6aab37fa0c54c4e..6d8f7d0737138f45d5a1b6183e0290c2f96b66d9 100644 (file)
@@ -3969,9 +3969,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        || cmd.x() > xo(cur.bv()) + tabular.width()) {
                        row_type r = rowFromY(cur, cmd.y());
                        cur.idx() = tabular.getFirstCellInRow(r);
+                       cur.pit() = 0;
                        cur.pos() = 0;
                        cur.resetAnchor();
                        cur.idx() = tabular.getLastCellInRow(r);
+                       cur.pit() = cur.lastpit();
                        cur.pos() = cur.lastpos();
                        cur.setSelection(true);
                        bvcur = cur;
@@ -3984,9 +3986,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        || cmd.y() > y0 + tabular.height()) {
                        col_type c = columnFromX(cur, cmd.x());
                        cur.idx() = tabular.cellIndex(0, c);
+                       cur.pit() = 0;
                        cur.pos() = 0;
                        cur.resetAnchor();
                        cur.idx() = tabular.cellIndex(tabular.nrows() - 1, c);
+                       cur.pit() = cur.lastpit();
                        cur.pos() = cur.lastpos();
                        cur.setSelection(true);
                        bvcur = cur;
@@ -5331,6 +5335,8 @@ void InsetTabular::movePrevCell(Cursor & cur, EntryDirection entry_from)
 
 void InsetTabular::tabularFeatures(Cursor & cur, string const & argument)
 {
+       cur.recordUndoInset(this);
+
        istringstream is(argument);
        string s;
        // Safe guard.
@@ -5457,8 +5463,6 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                break;
        }
 
-       cur.recordUndoInset(this);
-
        getSelection(cur, sel_row_start, sel_row_end, sel_col_start, sel_col_end);
        row_type const row = tabular.cellRow(cur.idx());
        col_type const column = tabular.cellColumn(cur.idx());