]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Add empty InsetLayout for undefined cases. Should avoid possible bugs caused by empty...
[lyx.git] / src / Buffer.cpp
index 7858c42ce8f15c324cfd2b2d48a03997ca866bd4..c90e30a2e267af9d7cff9199d7c2e1517e4509af 100644 (file)
@@ -113,7 +113,7 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 314; // Uwe Stöhr: scrlttr2 for serial letters
+int const LYX_FORMAT = 315; // Richard Heck: column separation
 
 } // namespace anon
 
@@ -466,6 +466,7 @@ int Buffer::readHeader(Lexer & lex)
        params().headheight.erase();
        params().headsep.erase();
        params().footskip.erase();
+       params().columnsep.erase();
        params().listings_params.clear();
        params().clearLayoutModules();
        params().pdfoptions().clear();
@@ -567,10 +568,7 @@ bool Buffer::readDocument(Lexer & lex)
        }
 
        // read main text
-       bool const res = text().read(*this, lex, errorList);
-       for_each(text().paragraphs().begin(),
-                text().paragraphs().end(),
-                bind(&Paragraph::setInsetOwner, _1, &inset()));
+       bool const res = text().read(*this, lex, errorList, &(d->inset));
 
        updateMacros();
        updateMacroInstances();
@@ -2314,6 +2312,9 @@ void Buffer::autoSave() const
 
 void Buffer::resetChildDocuments(bool close_them) const
 {
+       if (text().empty())
+               return;
+
        for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
                if (it->lyxCode() != INCLUDE_CODE)
                        continue;