* 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.
break;
}
}
- if (b && !closeBuffer(*b)) {
+ if (b && !closeBuffer(*b, true)) {
close_event->ignore();
return;
}
}
-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!
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;
// 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);
///
bool saveBuffer(Buffer & b);
///
- bool closeBuffer(Buffer & buf);
+ bool closeBuffer(Buffer & buf, bool tolastopened = false);
///
Inset * getOpenInset(std::string const & name) const;