a little bit saver buffer closing

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@792 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-06-05 19:36:14 +00:00
parent 609a11852e
commit 2f08c88821
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2000-06-05 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/bufferlist.C (close): test of buf->getuser() == NULL
2000-06-02 Dekel Tsur <dekel@math.tau.ac.il> 2000-06-02 Dekel Tsur <dekel@math.tau.ac.il>
* src/BufferView2.C (removeAutoInsets): Fix a bug: * src/BufferView2.C (removeAutoInsets): Fix a bug:

View File

@ -151,10 +151,13 @@ void BufferList::resize()
bool BufferList::close(Buffer * buf) bool BufferList::close(Buffer * buf)
{ {
if (buf->getUser()) buf->getUser()->insetUnlock(); // CHECK
// Trace back why we need to use buf->getUser here.
// Perhaps slight rewrite is in order? (Lgb)
if (buf->getUser()) buf->getUser()->insetUnlock();
if (buf->paragraph && !buf->isLyxClean() && !quitting) { if (buf->paragraph && !buf->isLyxClean() && !quitting) {
ProhibitInput(buf->getUser()); if (buf->getUser()) ProhibitInput(buf->getUser());
switch(AskConfirmation(_("Changes in document:"), switch(AskConfirmation(_("Changes in document:"),
MakeDisplayPath(buf->fileName(), 50), MakeDisplayPath(buf->fileName(), 50),
_("Save document?"))){ _("Save document?"))){
@ -162,15 +165,15 @@ bool BufferList::close(Buffer * buf)
if (buf->save()) { if (buf->save()) {
lastfiles->newFile(buf->fileName()); lastfiles->newFile(buf->fileName());
} else { } else {
AllowInput(buf->getUser()); if (buf->getUser()) AllowInput(buf->getUser());
return false; return false;
} }
break; break;
case 3: // Cancel case 3: // Cancel
AllowInput(buf->getUser()); if (buf->getUser()) AllowInput(buf->getUser());
return false; return false;
} }
AllowInput(buf->getUser()); if (buf->getUser()) AllowInput(buf->getUser());
} }
bstore.release(buf); bstore.release(buf);