]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
remove noload/don't typeset
[lyx.git] / src / bufferlist.C
index 4620d6b1ab8250283828aa9c3c297eea754a37d8..51e042724c84f111cb0fb1aa807cdd7589a420dc 100644 (file)
@@ -41,6 +41,8 @@
 #include "support/lyxfunctional.h"
 #include "support/LAssert.h"
 
+#include <boost/bind.hpp>
+
 #include <cassert>
 #include <algorithm>
 #include <functional>
@@ -181,7 +183,7 @@ bool BufferList::close(Buffer * buf)
        if (buf->getUser())
                buf->getUser()->insetUnlock();
 
-       if (buf->paragraph && !buf->isClean() && !quitting) {
+       if (!buf->paragraphs.empty() && !buf->isClean() && !quitting) {
                if (buf->getUser())
                        buf->getUser()->owner()->prohibitInput();
                string fname;
@@ -289,7 +291,7 @@ void BufferList::updateIncludedTeXfiles(string const & mastertmpdir)
 void BufferList::emergencyWriteAll()
 {
        for_each(bstore.begin(), bstore.end(),
-                lyx::void_class_fun(*this, &BufferList::emergencyWrite));
+                boost::bind(&BufferList::emergencyWrite, this, _1));
 }
 
 
@@ -304,9 +306,10 @@ void BufferList::emergencyWrite(Buffer * buf)
        if (buf->isClean())
                return;
 
-       lyxerr << fmt(_("lyx: Attempting to save document %s as..."),
-                     buf->isUnnamed() ? OnlyFilename(buf->fileName()).c_str()
-                     : buf->fileName().c_str()) << endl;
+       string const doc = buf->isUnnamed()
+               ? OnlyFilename(buf->fileName()) : buf->fileName();
+       lyxerr << _("LyX: Attempting to save document ") << doc << endl;
 
        // We try to save three places:
 
@@ -476,12 +479,12 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
                        Alert::alert(_("Error!"), _("Unable to open template"),
                                   MakeDisplayPath(tname));
                        // no template, start with empty buffer
-                       b->paragraph = new Paragraph;
-                       b->paragraph->layout(b->params.getLyXTextClass().defaultLayout());
+                       b->paragraphs.set(new Paragraph);
+                       b->paragraphs.begin()->layout(b->params.getLyXTextClass().defaultLayout());
                }
        } else {  // start with empty buffer
-               b->paragraph = new Paragraph;
-                       b->paragraph->layout(b->params.getLyXTextClass().defaultLayout());
+               b->paragraphs.set(new Paragraph);
+               b->paragraphs.begin()->layout(b->params.getLyXTextClass().defaultLayout());
        }
 
        if (!isNamed) {