From: Richard Heck Date: Tue, 10 May 2011 00:16:45 +0000 (+0000) Subject: Fix for bug #7319. This is an attempt to fix the bug cheaply. X-Git-Tag: 2.0.1~324 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cd49b3d5e23311e60e7c6858014117e8d3de3edd;p=features.git Fix for bug #7319. This is an attempt to fix the bug cheaply. 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/branches/BRANCH_2_0_X@38684 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Text.cpp b/src/Text.cpp index c231bcea8e..fad29a7459 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -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.