]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Add a comment.
[lyx.git] / src / Buffer.cpp
index e708db794f11bc8845fc372b73f8ce30b705f350..888f82072882f8237aada52558df3516180e92a9 100644 (file)
@@ -228,6 +228,9 @@ public:
        /// This is here to force the test to be done whenever parent_buffer
        /// is accessed.
        Buffer const * parent() const { 
+               // if parent_buffer is not loaded, then it has been unloaded,
+               // which means that parent_buffer is an invalid pointer. So we
+               // set it to null in that case.
                if (!theBufferList().isLoaded(parent_buffer))
                        parent_buffer = 0;
                return parent_buffer; 
@@ -608,6 +611,11 @@ bool Buffer::readDocument(Lexer & lex)
                        Buffer * master = 
                                checkAndLoadLyXFile(master_file, true);
                        if (master) {
+                               // necessary e.g. after a reload
+                               // to re-register the child (bug 5873)
+                               // FIXME: clean up updateMacros (here, only
+                               // child registering is needed).
+                               master->updateMacros();
                                // set master as master buffer, but only
                                // if we are a real child
                                if (master->isChild(this))
@@ -618,9 +626,9 @@ bool Buffer::readDocument(Lexer & lex)
                                else if (master->isFullyLoaded())
                                        LYXERR0("The master '"
                                                << params().master
-                                               << "' assigned to this document '"
+                                               << "' assigned to this document ("
                                                << absFileName()
-                                               << "' does not include "
+                                               << ") does not include "
                                                "this document. Ignoring the master assignment.");
                        }
                }