#include "support/lyxfunctional.h"
#include "support/LAssert.h"
+#include <boost/bind.hpp>
+
#include <cassert>
#include <algorithm>
#include <functional>
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
for (; it != end; ++it) {
- if (!(*it)->isLyxClean()) {
+ if (!(*it)->isClean()) {
string fname;
if ((*it)->isUnnamed())
fname = OnlyFilename((*it)->fileName());
if (buf->getUser())
buf->getUser()->insetUnlock();
- if (buf->paragraph && !buf->isLyxClean() && !quitting) {
+ if (!buf->paragraphs.empty() && !buf->isClean() && !quitting) {
if (buf->getUser())
buf->getUser()->owner()->prohibitInput();
string fname;
void BufferList::emergencyWriteAll()
{
for_each(bstore.begin(), bstore.end(),
- lyx::void_class_fun(*this, &BufferList::emergencyWrite));
+ boost::bind(&BufferList::emergencyWrite, this, _1));
}
// No need to save if the buffer has not changed.
- if (buf->isLyxClean())
+ 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:
s += ".emergency";
lyxerr << " " << s << endl;
if (buf->writeFile(s)) {
- buf->markLyxClean();
+ buf->markClean();
lyxerr << _(" Save seems successful. Phew.") << endl;
return;
} else {
s += ".emergency";
lyxerr << " " << s << endl;
if (buf->writeFile(s)) {
- buf->markLyxClean();
+ buf->markClean();
lyxerr << _(" Save seems successful. Phew.") << endl;
return;
}
s += ".emergency";
lyxerr << " " << s << endl;
if (buf->writeFile(s)) {
- buf->markLyxClean();
+ buf->markClean();
lyxerr << _(" Save seems successful. Phew.") << endl;
return;
}
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) {