From: Jürgen Spitzmüller Date: Sun, 20 Apr 2008 12:20:40 +0000 (+0000) Subject: Fix bug 4750 X-Git-Tag: 1.6.10~5090 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4d88adcde562e9745dcc497a44543db2f7d2291f;p=features.git Fix bug 4750 * src/frontends/qt4/GuiView.{cpp,h}: - (closeBuffer): only add buffer to list of last opened files if close buffer is called from within GuiView::closeEvent * src/Session.cpp: typo. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24384 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Session.cpp b/src/Session.cpp index 9291ef1c22..2d05a0e7fe 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Bo Peng * * Full author contact details are available in file CREDITS. diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 2ff88433a7..ffb301e488 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -411,7 +411,7 @@ void GuiView::closeEvent(QCloseEvent * close_event) break; } } - if (b && !closeBuffer(*b)) { + if (b && !closeBuffer(*b, true)) { close_event->ignore(); return; } @@ -1605,7 +1605,7 @@ bool GuiView::closeBuffer() } -bool GuiView::closeBuffer(Buffer & buf) +bool GuiView::closeBuffer(Buffer & buf, bool tolastopened) { // goto bookmark to update bookmark pit. //FIXME: we should update only the bookmarks related to this buffer! @@ -1613,7 +1613,7 @@ bool GuiView::closeBuffer(Buffer & buf) theLyXFunc().gotoBookmark(i+1, false, false); if (buf.isClean() || buf.paragraphs().empty()) { - if (buf.masterBuffer() == &buf) + if (buf.masterBuffer() == &buf && tolastopened) LyX::ref().session().lastOpened().add(buf.fileName()); theBufferList().release(&buf); return true; @@ -1655,7 +1655,7 @@ bool GuiView::closeBuffer(Buffer & buf) // save file names to .lyx/session // if master/slave are both open, do not save slave since it // will be automatically loaded when the master is loaded - if (buf.masterBuffer() == &buf) + if (buf.masterBuffer() == &buf && tolastopened) LyX::ref().session().lastOpened().add(buf.fileName()); theBufferList().release(&buf); diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 8bd547dbdd..dcd0dffb25 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -276,7 +276,7 @@ private: /// bool saveBuffer(Buffer & b); /// - bool closeBuffer(Buffer & buf); + bool closeBuffer(Buffer & buf, bool tolastopened = false); /// Inset * getOpenInset(std::string const & name) const;