case LFUN_LYX_QUIT:
// quitting is triggered by the gui code
// (leaving the event loop).
- current_view_->message(from_utf8(N_("Exiting.")));
+ if (current_view_)
+ current_view_->message(from_utf8(N_("Exiting.")));
if (closeAllViews())
quit();
break;
#endif
}
view->setFocus();
- setCurrentView(*view);
+ setCurrentView(view);
}
///
GuiView * currentView() { return current_view_; }
///
- void setCurrentView(GuiView & view) { current_view_ = &view; }
+ void setCurrentView(GuiView * view) { current_view_ = view; }
///
virtual size_t viewCount() const { return view_ids_.size(); }
///
GuiView::~GuiView()
{
+ if (guiApp->currentView() == this)
+ guiApp->setCurrentView(0);
+ theLyXFunc().setLyXView(0);
+
delete &d;
}
setFocus();
return QMainWindow::event(e);
}
- guiApp->setCurrentView(*this);
+ guiApp->setCurrentView(this);
if (d.current_work_area_) {
BufferView & bv = d.current_work_area_->bufferView();
connectBufferView(bv);
bool InsetMathNest::script(Cursor & cur, bool up)
{
- script(cur, up, docstring());
+ return script(cur, up, docstring());
}