I will submit a patch to prevent such a crash with a FIXME in its
comment. A bugzilla entry will also be created.

Hi, Jose,

See http://bugzilla.lyx.org/show_bug.cgi?id=3600 .

Can I submit the following patch before a proper solution is
implemented? My understand is that a proper solution will be
difficult, but avoiding such a crash for now is necessary.


Index: src/CutAndPaste.cpp
===================================================================
--- src/CutAndPaste.cpp (revision 18290)
+++ src/CutAndPaste.cpp (working copy)
@@ -301,7 +301,11 @@

       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 hack for bug 3600, a proper
solution is needed
+               // see details at 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);

Thanks.
Bo

Reply via email to