From e554bf9a8d5c5eb464c5530172a189374ed93cb7 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 14 Aug 2006 19:02:04 +0000 Subject: [PATCH] * text2.C (changeDepthAllowed): exit early when selection spans several cells (bug 2630) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@14677 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/text2.C | 4 ++++ status.14x | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 2f3a037680..992bcd826a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-14 Jean-Marc Lasgouttes + + * text2.C (changeDepthAllowed): exit early when selection spans + several cells (bug 2630) + 2006-08-13 Jean-Marc Lasgouttes * dociterator.C (forwardPosNoDescend): when at the end of the diff --git a/src/text2.C b/src/text2.C index feb5749ce4..3496cc088d 100644 --- a/src/text2.C +++ b/src/text2.C @@ -385,6 +385,10 @@ bool changeDepthAllowed(LyXText::DEPTH_CHANGE type, bool LyXText::changeDepthAllowed(LCursor & cur, DEPTH_CHANGE type) const { BOOST_ASSERT(this == cur.text()); + // this happens when selecting several cells in tabular (bug 2630) + if (cur.selBegin().idx() != cur.selEnd().idx()) + return false; + pit_type const beg = cur.selBegin().pit(); pit_type const end = cur.selEnd().pit() + 1; int max_depth = (beg != 0 ? pars_[beg - 1].getMaxDepthAfter() : 0); diff --git a/status.14x b/status.14x index 8d179887cb..c19eb2055c 100644 --- a/status.14x +++ b/status.14x @@ -60,6 +60,8 @@ What's new - Fix crash on save (including dataloss) when the backup directory was invalid or not writeable(bug 2740). +- Fix crash when selecting several cells in a tabular (bug 2630). + - Fix lockup when accepting a change in a text inset (bug 2510). - Fix editing of document while Error List dialog is open (bug 2179).