]> git.lyx.org Git - lyx.git/blobdiff - src/buffer_funcs.cpp
Change the "empty layout" to the "plain layout", to try to avoid confusion.
[lyx.git] / src / buffer_funcs.cpp
index 21d9e1a9a00c38bf3d77877d8b397fbdbfacb9e6..17aab767c2c91c04b3a86a78533a7c5d97cd87da 100644 (file)
@@ -60,7 +60,7 @@ namespace Alert = frontend::Alert;
 Buffer * checkAndLoadLyXFile(FileName const & filename)
 {
        // File already open?
-       Buffer * checkBuffer = theBufferList().getBuffer(filename.absFilename());
+       Buffer * checkBuffer = theBufferList().getBuffer(filename);
        if (checkBuffer) {
                if (checkBuffer->isClean())
                        return checkBuffer;
@@ -466,7 +466,6 @@ void updateLabels(Buffer const & buf, ParIterator & parit)
                InsetList::const_iterator end = parit->insetList().end();
                for (; iit != end; ++iit) {
                        parit.pos() = iit->pos;
-                       iit->inset->setBuffer(const_cast<Buffer &>(buf));
                        iit->inset->updateLabels(parit);
                }
        }
@@ -491,19 +490,13 @@ void updateLabels(Buffer const & buf, bool childonly)
                // start over the counters
                textclass.counters().reset();
                buf.clearReferenceCache();
+               buf.inset().setBuffer(const_cast<Buffer &>(buf));
                buf.updateMacros();
        }
 
        Buffer & cbuf = const_cast<Buffer &>(buf);
 
-       if (buf.text().empty()) {
-               // FIXME: we don't call continue with updateLabels()
-               // here because it crashes on newly created documents.
-               // But the TocBackend needs to be initialised
-               // nonetheless so we update the tocBackend manually.
-               cbuf.tocBackend().update();
-               return;
-       }
+       BOOST_ASSERT(!buf.text().paragraphs().empty());
 
        // do the real work
        ParIterator parit = par_iterator_begin(buf.inset());