]> git.lyx.org Git - features.git/commitdiff
Fix bug #8782.
authorRichard Heck <rgheck@lyx.org>
Thu, 30 Jun 2016 18:53:19 +0000 (14:53 -0400)
committerRichard Heck <rgheck@lyx.org>
Thu, 30 Jun 2016 18:57:08 +0000 (14:57 -0400)
We need to invalidate the BibTeX cache when undoing or redoing. I do
not like having to do it for every undo or redo. We should only have
to do it if we restored or deleted an InsetBibTeX. But there is no
way, so far as I can see, to do it that way. I tried.

src/BufferView.cpp

index 6922770f2966c558fe8d28f867c094f43eeeed0d..f4b68592b0e366ce98afc31b158c49f43cf6588f 100644 (file)
@@ -1349,6 +1349,13 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                else
                        dr.screenUpdate(Update::Force | Update::FitCursor);
                dr.forceBufferUpdate();
+               // we only need to do this if we have deleted or restored a
+               // BiBTeX inset. but there is no other place to do it. one
+               // obvious idea is to try to do it in a copy constructor for
+               // InsetBibTeX, but when that is invoked, the buffer_ member 
+               // is not yet set.
+               buffer().invalidateBibfileCache();
+               buffer().removeBiblioTempFiles();
                break;
 
        case LFUN_REDO:
@@ -1359,6 +1366,9 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                else
                        dr.screenUpdate(Update::Force | Update::FitCursor);
                dr.forceBufferUpdate();
+               // see above
+               buffer().invalidateBibfileCache();
+               buffer().removeBiblioTempFiles();
                break;
 
        case LFUN_FONT_STATE: