]> git.lyx.org Git - features.git/blobdiff - src/Buffer.cpp
support for default master document.
[features.git] / src / Buffer.cpp
index 2caf701774cb5387551f997ec1e8da9c3a84e940..686fee33c4cb43158ad7d7e8a8372ccc5ddfe9f5 100644 (file)
@@ -115,7 +115,7 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 328;
+int const LYX_FORMAT = 329;
 
 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));