* 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
This commit is contained in:
Jürgen Spitzmüller 2009-03-20 09:31:02 +00:00
parent a6d6c632fd
commit 8d8462afaf

View 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())