]> git.lyx.org Git - features.git/commitdiff
* text2.C (changeDepthAllowed): exit early when selection spans
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 14 Aug 2006 19:14:44 +0000 (19:14 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 14 Aug 2006 19:14:44 +0000 (19:14 +0000)
several cells (bug 2630)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14678 a592a061-630c-0410-9148-cb99ea01b6c8

src/text2.C

index cc1cda40c53c094d2d2e4cd042af51a44932ce63..5cdcd564a179c577e88cd9cf758e18e68bf645c3 100644 (file)
@@ -407,6 +407,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);