X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbufferlist.C;h=4620d6b1ab8250283828aa9c3c297eea754a37d8;hb=7c98b3bd37f41ad05e9770d66774f999fbd17ff8;hp=fc642d8c1d441fa9539fef25ccb07e10105e2882;hpb=9548351ef8ceaa1c779267e4eeccd3a0d83a0374;p=lyx.git diff --git a/src/bufferlist.C b/src/bufferlist.C index fc642d8c1d..4620d6b1ab 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -31,7 +31,7 @@ #include "frontends/LyXView.h" #include "vc-backend.h" #include "TextCache.h" -#include "lyxtextclasslist.h" +#include "lyxlex.h" #include "frontends/Alert.h" @@ -141,7 +141,7 @@ bool BufferList::qwriteAll() 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()); @@ -152,11 +152,6 @@ bool BufferList::qwriteAll() } } - if (!unsaved.empty() && lyxrc.exit_confirmation) { - return Alert::askQuestion(_("Some documents were not saved:"), - unsaved, _("Exit anyway?")); - } - return true; } @@ -186,7 +181,7 @@ bool BufferList::close(Buffer * buf) if (buf->getUser()) buf->getUser()->insetUnlock(); - if (buf->paragraph && !buf->isLyxClean() && !quitting) { + if (buf->paragraph && !buf->isClean() && !quitting) { if (buf->getUser()) buf->getUser()->owner()->prohibitInput(); string fname; @@ -306,7 +301,7 @@ void BufferList::emergencyWrite(Buffer * buf) // 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..."), @@ -320,8 +315,8 @@ void BufferList::emergencyWrite(Buffer * buf) string s = buf->fileName(); s += ".emergency"; lyxerr << " " << s << endl; - if (buf->writeFile(s, true)) { - buf->markLyxClean(); + if (buf->writeFile(s)) { + buf->markClean(); lyxerr << _(" Save seems successful. Phew.") << endl; return; } else { @@ -333,8 +328,8 @@ void BufferList::emergencyWrite(Buffer * buf) string s = AddName(GetEnvPath("HOME"), buf->fileName()); s += ".emergency"; lyxerr << " " << s << endl; - if (buf->writeFile(s, true)) { - buf->markLyxClean(); + if (buf->writeFile(s)) { + buf->markClean(); lyxerr << _(" Save seems successful. Phew.") << endl; return; } @@ -347,8 +342,8 @@ void BufferList::emergencyWrite(Buffer * buf) s = AddName(MakeAbsPath("/tmp/"), buf->fileName()); s += ".emergency"; lyxerr << " " << s << endl; - if (buf->writeFile(s, true)) { - buf->markLyxClean(); + if (buf->writeFile(s)) { + buf->markClean(); lyxerr << _(" Save seems successful. Phew.") << endl; return; } @@ -482,14 +477,14 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed) MakeDisplayPath(tname)); // no template, start with empty buffer b->paragraph = new Paragraph; - b->paragraph->layout(textclasslist[b->params.textclass].defaultLayoutName()); + b->paragraph->layout(b->params.getLyXTextClass().defaultLayout()); } } else { // start with empty buffer b->paragraph = new Paragraph; - b->paragraph->layout(textclasslist[b->params.textclass].defaultLayoutName()); + b->paragraph->layout(b->params.getLyXTextClass().defaultLayout()); } - if (!lyxrc.new_ask_filename && !isNamed) { + if (!isNamed) { b->setUnnamed(); b->setFileName(name); }