]> 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 3aeac0a9e89610f67ea0cf1f216eab1266d9757f..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;
@@ -4872,7 +4876,7 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
 }
 
 
-// function sets an object as defined in func_status.h:
+// function sets an object as defined in FuncStatus.h:
 // states OK, Unknown, Disabled, On, Off.
 bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                              FuncStatus & status) const
@@ -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());