]> git.lyx.org Git - lyx.git/commitdiff
Fix bug 4750
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 20 Apr 2008 12:20:40 +0000 (12:20 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 20 Apr 2008 12:20:40 +0000 (12:20 +0000)
* 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

src/Session.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index 9291ef1c2213bfcd974a4a992544446915bee8fe..2d05a0e7fe3041ac4bb8e14cd4b90d62dac3a8ac 100644 (file)
@@ -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.
index 2ff88433a7735ba35144079ed8067238fc1b6f60..ffb301e4889dfccefde885f69c3454042a4d2059 100644 (file)
@@ -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);
index 8bd547dbdd3a7bcebc9a4605b5c2bb7ef45e82b3..dcd0dffb25ac0db461a5615201f83f8ab9cc92ae 100644 (file)
@@ -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;