From ebfe9d60d7ecd1e0fcfb4c226732f121cc7baa75 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 9 Aug 2008 16:29:25 +0000 Subject: [PATCH] The previous commit inadvertently contained some of this one, which is just a renaming. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26110 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.h | 5 ++++- src/insets/InsetTabular.cpp | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Cursor.h b/src/Cursor.h index 8b76fb35d4..edb2f862cc 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -72,8 +72,11 @@ public: /// selection active? bool & selection() { return selection_; } /// do we have a multicell selection? - bool isMultiCell() const + bool selIsMultiCell() const { return selection_ && selBegin().idx() != selEnd().idx(); } + /// do we have a multiline selection? + bool selIsMultiLine() const + { return selection_ && selBegin().pit() != selEnd().pit(); } /// did we place the anchor? bool mark() const { return mark_; } /// did we place the anchor? diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index c1cf117b29..61a9a68a73 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -2995,7 +2995,7 @@ void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const //resetPos(cur); - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { row_type rs, re; col_type cs, ce; getSelection(cur, rs, re, cs, ce); @@ -3166,7 +3166,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) // some cells (bug 2715). if (cmd.button() == mouse_button::button3 && &bvcur.selBegin().inset() == this - && bvcur.isMultiCell()) + && bvcur.selIsMultiCell()) ; else // Let InsetTableCell do it @@ -3214,7 +3214,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) bvcur.selection() = true; // if this is a multicell selection, we just set the cursor to // the beginning of the cell's text. - if (bvcur.isMultiCell()) { + if (bvcur.selIsMultiCell()) { bvcur.pit() = 0; bvcur.pos() = 0; } @@ -3279,7 +3279,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) } // if we don't have a multicell selection... - if (!cur.isMultiCell() || + if (!cur.selIsMultiCell() || // ...or we're not doing some LFUN_*_SELECT thing, anyway... (cmd.action != LFUN_CHAR_FORWARD_SELECT && cmd.action != LFUN_CHAR_BACKWARD_SELECT && @@ -3423,7 +3423,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_CUT: - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { if (copySelection(cur)) { cur.recordUndoInset(DELETE_UNDO); cutSelection(cur); @@ -3435,7 +3435,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_CHAR_DELETE_BACKWARD: case LFUN_CHAR_DELETE_FORWARD: - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { cur.recordUndoInset(DELETE_UNDO); cutSelection(cur); } @@ -3446,7 +3446,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_COPY: if (!cur.selection()) break; - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { cur.finishUndo(); copySelection(cur); } else @@ -3507,7 +3507,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_WORD_UPCASE: case LFUN_WORD_LOWCASE: case LFUN_CHARS_TRANSPOSE: - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { row_type rs, re; col_type cs, ce; getSelection(cur, rs, re, cs, ce); @@ -3779,7 +3779,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_BRANCH_INSERT: case LFUN_WRAP_INSERT: case LFUN_ERT_INSERT: { - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { status.setEnabled(false); return true; } else @@ -3801,7 +3801,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, return true; case LFUN_PASTE: - if (cur.isMultiCell()) { + if (cur.selIsMultiCell()) { status.setEnabled(false); status.message(_("You cannot paste into a multicell selection.")); return true; -- 2.39.5