]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Ensure the focus is returned to the editing area after a dispatch.
[lyx.git] / src / Buffer.cpp
index 2caf701774cb5387551f997ec1e8da9c3a84e940..3e2877ade43c9565216dbb4c492088468440cc27 100644 (file)
@@ -76,7 +76,7 @@
 
 #include "graphics/Previews.h"
 
-#include "support/assert.h"
+#include "support/lassert.h"
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/ExceptionMessage.h"
@@ -115,7 +115,7 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 328;
+int const LYX_FORMAT = 334;
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
@@ -441,6 +441,7 @@ int Buffer::readHeader(Lexer & lex)
        params().branchlist().clear();
        params().preamble.erase();
        params().options.erase();
+       params().master.erase();
        params().float_placement.erase();
        params().paperwidth.erase();
        params().paperheight.erase();
@@ -550,6 +551,15 @@ bool Buffer::readDocument(Lexer & lex)
                }
        }
 
+       if (!params().master.empty()) {
+               FileName const master_file = makeAbsPath(params().master,
+                          onlyPath(absFileName()));
+               if (isLyXFilename(master_file.absFilename())) {
+                       Buffer * master = checkAndLoadLyXFile(master_file);
+                       d->parent_buffer = master;
+               }
+       }
+
        // read main text
        bool const res = text().read(*this, lex, errorList, &(d->inset));