for (size_t i = 0; i < theSession().bookmarks().size(); ++i)
theLyXFunc().gotoBookmark(i+1, false, false);
- if (buf.isClean() || buf.paragraphs().empty()) {
+ if (saveBufferIfNeeded(buf)) {
// save in sessions if requested
// do not save childs if their master
// is opened as well
theBufferList().release(&buf);
return true;
}
+ return false;
+}
+
+
+bool GuiView::saveBufferIfNeeded(Buffer & buf)
+{
+ if (buf.isClean() || buf.paragraphs().empty())
+ return true;
+
// Switch to this Buffer.
setBuffer(&buf);
case 2:
return false;
}
-
- // save file names to .lyx/session
- if (tolastopened)
- theSession().lastOpened().add(buf.fileName(), mark_active);
-
- if (buf.parent())
- // Don't close child documents.
- removeWorkArea(currentMainWorkArea());
- else
- theBufferList().release(&buf);
-
return true;
}
bool closeBuffer(Buffer & buf, bool tolastopened = false,
bool mark_active = false);
///
+ bool saveBufferIfNeeded(Buffer & buf);
+ ///
bool closeBufferAll(bool tolastopened = false);
///
enum NextOrPrevious {