Hello!

The crash happens on alt+up and alt+down if the position of the cursor in the moved paragraph is beyond the length of the target paragraph.

To avoid it the Position of the iterators for the target paragraph must be corrected. I set it to 0 as i assume it is not really used.

Bernhard
Index: src/text3.C
===================================================================
--- src/text3.C (revision 17599)
+++ src/text3.C (working copy)
@@ -333,6 +333,7 @@
                std::swap(pars_[pit], pars_[pit + 1]);
 
                ParIterator begin(cur);
+               begin.pos() = 0;
                ++cur.pit();
                ParIterator end = boost::next(ParIterator(cur));
                updateLabels(cur.buffer(), begin, end);
@@ -347,7 +348,9 @@
                finishUndo();
                std::swap(pars_[pit], pars_[pit - 1]);
 
-               ParIterator end = boost::next(ParIterator(cur));
+               ParIterator end = ParIterator(cur);
+               end.pos() = 0;
+               end = boost::next(end);
                --cur.pit();
                ParIterator begin(cur);
                updateLabels(cur.buffer(), begin, end);

Reply via email to