]> git.lyx.org Git - features.git/commitdiff
Fix for bug #7319. This is an attempt to fix the bug cheaply.
authorRichard Heck <rgheck@comcast.net>
Mon, 9 May 2011 23:23:24 +0000 (23:23 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 9 May 2011 23:23:24 +0000 (23:23 +0000)
We clear the refernce cache so that we won't get conflicts with labels
that get pasted into the buffer. We should update this before its being
empty matters. If not (i.e., if we encounter bugs), then this should
instead be:
  cur.buffer().updateBuffer();
But we'll try the cheaper solution in trunk.

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

src/Text.cpp

index c231bcea8e8526ef64b58d37caa154832a7190fc..fad29a745972b674fe267c101bf58319f249fc22 100644 (file)
@@ -1641,7 +1641,17 @@ bool Text::dissolveInset(Cursor & cur)
        spit += cur.pit();
        Buffer & b = *cur.buffer();
        cur.paragraph().eraseChar(cur.pos(), b.params().trackChanges);
+
        if (!plist.empty()) {
+               // see bug 7319
+               // we clear the cache so that we won't get conflicts with labels
+               // that get pasted into the buffer. we should update this before
+               // its being empty matters. if not (i.e., if we encounter bugs),
+               // then this should instead be:
+               //        cur.buffer().updateBuffer();
+               // but we'll try the cheaper solution here.
+               cur.buffer()->clearReferenceCache();
+
                // ERT paragraphs have the Language latex_language.
                // This is invalid outside of ERT, so we need to
                // change it to the buffer language.