]> git.lyx.org Git - features.git/commitdiff
Bug 3600, not a real solution but prevents lyx from crashing
authorBo Peng <bpeng@lyx.org>
Mon, 14 May 2007 03:07:00 +0000 (03:07 +0000)
committerBo Peng <bpeng@lyx.org>
Mon, 14 May 2007 03:07:00 +0000 (03:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18299 a592a061-630c-0410-9148-cb99ea01b6c8

src/CutAndPaste.cpp

index c05e80130dda48e8b8f4ec81cc5e77feeb4fac99..07c74cd3eda21f9d64d0e5664fa276c160d05f53 100644 (file)
@@ -301,7 +301,12 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
 
        for (pit_type pit = startpit; pit != endpit + 1;) {
                pos_type const left  = (pit == startpit ? startpos : 0);
-               pos_type const right = (pit == endpit ? endpos : pars[pit].size() + 1);
+               pos_type right = (pit == endpit ? endpos : pars[pit].size() + 1);
+               // FIXME: this is a quick fix for bug 3600. It stops a crash but the problem
+               // still remains unsolved (e.g. the second example in the bug report).
+               // c.f. http://bugzilla.lyx.org/show_bug.cgi?id=3600
+               if (right > pars[pit].size() + 1)
+                       right = pars[pit].size() + 1;
 
                bool const merge = pars[pit].isMergedOnEndOfParDeletion(params.trackChanges);