}
+bool GuiView::closeWorkArea(GuiWorkArea * wa)
+{
+ return closeWorkArea(wa, true);
+}
+
+
bool GuiView::closeBuffer()
{
GuiWorkArea * wa = currentMainWorkArea();
bool closeBuffer();
/// hides the workarea and makes sure it is clean
bool hideWorkArea(GuiWorkArea * wa);
+ /// closes the workarea
+ bool closeWorkArea(GuiWorkArea * wa);
/// load a document into the current workarea.
Buffer * loadDocument(support::FileName const & name, ///< File to load.
bool tolastfiles = true); ///< append to the "Open recent" menu?
void TabWorkArea::closeCurrentBuffer()
{
- if (clicked_tab_ != -1)
- setCurrentIndex(clicked_tab_);
- else
- // Before dispatching the LFUN we should be sure this
- // is the current workarea.
- currentWorkAreaChanged(currentWorkArea());
-
- lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
+ GuiWorkArea * wa;
+ if (clicked_tab_ == -1)
+ wa = currentWorkArea();
+ else {
+ wa = dynamic_cast<GuiWorkArea *>(widget(clicked_tab_));
+ LASSERT(wa, /**/);
+ }
+ wa->view().closeWorkArea(wa);
}