]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
GuiPainter.cpp: correct attempt from r35491
[lyx.git] / src / Buffer.cpp
index 5a228f4cc3fc3c7a66252a4b2c53d11ab11a3cc9..a679427fcd19d918295b6f87e5659d8f0e7ad343 100644 (file)
@@ -127,7 +127,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 398; // uwestoehr: support for \mathscr
+int const LYX_FORMAT = 401; // Ronen: support for \Diagram
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
@@ -279,12 +279,19 @@ public:
                        parent_buffer = 0;
                return parent_buffer; 
        }
+       
        ///
        void setParent(Buffer const * pb) {
-               if (!cloned_buffer_ 
-                   && parent_buffer && pb && parent_buffer != pb)
+               if (parent_buffer == pb)
+                       // nothing to do
+                       return;
+               if (!cloned_buffer_ && parent_buffer && pb)
                        LYXERR0("Warning: a buffer should not have two parents!");
                parent_buffer = pb;
+               if (!cloned_buffer_ && parent_buffer) {
+                       parent_buffer->invalidateBibfileCache();
+                       parent_buffer->invalidateBibinfoCache();
+               }
        }
 
        /// If non zero, this buffer is a clone of existing buffer \p cloned_buffer_
@@ -4026,6 +4033,7 @@ int Buffer::spellCheck(DocIterator & from, DocIterator & to,
                if (from == end)
                        break;
                to = from;
+               from.paragraph().spellCheck();
                SpellChecker::Result res = from.paragraph().spellCheck(from.pos(), to.pos(), wl, suggestions);
                if (SpellChecker::misspelled(res)) {
                        word_lang = wl;