]> git.lyx.org Git - features.git/commitdiff
* GuiView.cpp (closeEvent):
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 20 Mar 2009 09:31:02 +0000 (09:31 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 20 Mar 2009 09:31:02 +0000 (09:31 +0000)
- store child documents in session.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28874 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 0d32400d777acdeadba5b84347b67e0a4370e575..4ceaea36a1a823fd1f3f3a09dc474ccbc4a9d2fd 100644 (file)
@@ -535,7 +535,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
                if (b->parent()) {
                        // This is a child document, just close the tab
                        // after saving but keep the file loaded.
-                       if (!closeBuffer(*b, false)) {
+                       if (!closeBuffer(*b, true)) {
                                closing_ = false;
                                close_event->ignore();
                                return;
@@ -1868,7 +1868,10 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened)
                theLyXFunc().gotoBookmark(i+1, false, false);
 
        if (buf.isClean() || buf.paragraphs().empty()) {
-               if (buf.masterBuffer() == &buf && tolastopened)
+               // save in sessions if requested
+               // do not save childs if their master
+               // is opened as well
+               if (tolastopened)
                        theSession().lastOpened().add(buf.fileName());
                if (buf.parent())
                        // Don't close child documents.
@@ -1912,9 +1915,7 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened)
        }
 
        // 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 && tolastopened)
+       if (tolastopened)
                theSession().lastOpened().add(buf.fileName());
 
        if (buf.parent())