bool GuiView::closeWorkAreaAll()
{
- // To write in the session file which workarea was active.
- GuiWorkArea * active_wa = currentMainWorkArea();
- setCurrentWorkArea(active_wa);
+ setCurrentWorkArea(currentMainWorkArea());
// We might be in a situation that there is still a tabWorkArea, but
// there are no tabs anymore. This can happen when we get here after a
++empty_twa;
else {
setCurrentWorkArea(twa->currentWorkArea());
- if (!closeTabWorkArea(twa, active_wa))
+ if (!closeTabWorkArea(twa))
return false;
}
}
}
-bool GuiView::closeWorkArea(GuiWorkArea * wa, bool close_buffer,
- bool)
+bool GuiView::closeWorkArea(GuiWorkArea * wa, bool close_buffer)
{
Buffer & buf = wa->bufferView().buffer();
}
-bool GuiView::closeTabWorkArea(TabWorkArea * twa, GuiWorkArea * main_work_area)
+bool GuiView::closeTabWorkArea(TabWorkArea * twa)
{
while (twa == d.currentTabWorkArea()) {
twa->setCurrentIndex(twa->count()-1);
GuiWorkArea * wa = twa->currentWorkArea();
- bool const is_active_wa = main_work_area == wa;
Buffer & b = wa->bufferView().buffer();
// We only want to close the buffer if the same buffer is not visible
bool const close_buffer =
!inMultiViews(wa) && !b.parent() && closing_;
- if (!closeWorkArea(wa, close_buffer, is_active_wa))
+ if (!closeWorkArea(wa, close_buffer))
return false;
}
return true;
case LFUN_CLOSE_TAB_GROUP:
if (TabWorkArea * twa = d.currentTabWorkArea()) {
- closeTabWorkArea(twa, false);
+ closeTabWorkArea(twa);
d.current_work_area_ = 0;
twa = d.currentTabWorkArea();
// Switch to the next GuiWorkArea in the found TabWorkArea.
bool saveBuffer(Buffer & b);
/// closes a workarea, if close_buffer is true the buffer will
/// also be released, otherwise the buffer will be hidden.
- bool closeWorkArea(GuiWorkArea * wa, bool close_buffer,
- bool is_active = false);
+ bool closeWorkArea(GuiWorkArea * wa, bool close_buffer);
/// closes the tabworkarea and all tabs. If we are in a close event,
/// all buffers will be closed, otherwise they will be hidden.
/// main_work_area is the workarea marked in the session file as active.
- bool closeTabWorkArea(TabWorkArea * twa,
- GuiWorkArea * main_work_area = 0);
+ bool closeTabWorkArea(TabWorkArea * twa);
/// gives the user the possibility to save his work
/// or to discard the changes. If hiding is true, the
/// document will be reloaded.