]> git.lyx.org Git - features.git/commitdiff
Fix bug 3719: TOC skip-to points out of sync with document
authorAbdelrazak Younes <younes@lyx.org>
Wed, 11 Jul 2007 13:20:19 +0000 (13:20 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 11 Jul 2007 13:20:19 +0000 (13:20 +0000)
http://bugzilla.lyx.org/show_bug.cgi?id=3719

The problem is that the full toc is not regenerated when creating standard (i.e unnembered) paragraph. As the TocBackEnd use ParIterator for in buffer jumps, this can get out of sync. The partial updateLabel() is my doing and comes before the TocBackend stuf.

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

src/Text.cpp
src/Text3.cpp

index cd4a7c2cb5d2e39cba13edf90eba844e19ea46df..db8929e4c0cca752fc0e5965ee4cc862238265a9 100644 (file)
@@ -644,12 +644,7 @@ void Text::breakParagraph(Cursor & cur, bool keep_layout)
                        break; // the character couldn't be deleted physically due to change tracking
        }
 
-       ParIterator current_it(cur);
-       ParIterator last_it(cur);
-       ++last_it;
-       ++last_it;
-
-       updateLabels(cur.buffer(), current_it, last_it);
+       updateLabels(cur.buffer());
 
        // A singlePar update is not enough in this case.
        cur.updateFlags(Update::Force);
index 1b9618654a85f9fdc2e46449c196e463d0d5e59a..eac2e0ba91f34a9641be209daf2e095aabd14b6a 100644 (file)
@@ -375,16 +375,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                recUndo(cur, pit, pit + 1);
                finishUndo();
                std::swap(pars_[pit], pars_[pit + 1]);
-
-               ParIterator begin(cur);
-               // begin.pos() (== cur.pos()) may point beyond the end of the
-               // paragraph referenced by begin. This would cause a crash
-               // in updateLabels()
-               begin.pos() = 0;
-               ++cur.pit();
-               ParIterator end = boost::next(ParIterator(cur));
-               updateLabels(cur.buffer(), begin, end);
-
+               updateLabels(cur.buffer());
                needsUpdate = true;
                break;
        }
@@ -394,17 +385,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                recUndo(cur, pit - 1, pit);
                finishUndo();
                std::swap(pars_[pit], pars_[pit - 1]);
-
-               ParIterator end = ParIterator(cur);
-               // end.pos() (== cur.pos()) may point beyond the end of the
-               // paragraph referenced by end. This would cause a crash
-               // in boost::next()
-               end.pos() = 0;
-               end = boost::next(end);
-               --cur.pit();
-               ParIterator begin(cur);
-               updateLabels(cur.buffer(), begin, end);
-
+               updateLabels(cur.buffer());
                needsUpdate = true;
                break;
        }