From 8d8462afafc08f5314675a116b8a9d55a914d131 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 20 Mar 2009 09:31:02 +0000 Subject: [PATCH] * GuiView.cpp (closeEvent): - 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 0d32400d77..4ceaea36a1 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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()) -- 2.39.2