}
-LyXView const & Application::currentView() const
+LyXView const * Application::currentView() const
{
- return *current_view_;
+ return current_view_;
}
-LyXView & Application::currentView()
+LyXView * Application::currentView()
{
- return *current_view_;
+ return current_view_;
}
const std::string & geometryArg);
///
- LyXView const & currentView() const;
+ LyXView const * currentView() const;
///
- LyXView & currentView();
+ LyXView * currentView();
///
void setCurrentView(LyXView & current_view);
// No need to do anything if this is the current view. The BufferView
// metrics are already up to date.
- if (&lyx_view_ != &theApp()->currentView())
+ if (&lyx_view_ != theApp()->currentView())
// FIXME: it would be nice to optimize for the off-screen case.
buffer_view_->updateMetrics(false);
#ifdef Q_WS_X11
bool GuiApplication::x11EventFilter(XEvent * xev)
{
- BufferView * bv = currentView().view();
+ if (!currentView())
+ return false;
+
+ BufferView * bv = currentView()->view();
switch (xev->type) {
case SelectionRequest:
void GuiWorkArea::focusInEvent(QFocusEvent * /*event*/)
{
// No need to do anything if we didn't change views...
- if (theApp() == 0 || &lyx_view_ == &theApp()->currentView())
+ if (theApp() == 0 || &lyx_view_ == theApp()->currentView())
return;
theApp()->setCurrentView(lyx_view_);
void GuiWorkArea::focusOutEvent(QFocusEvent * /*event*/)
{
// No need to do anything if we didn't change views...
- if (&lyx_view_ == &theApp()->currentView())
+ if (&lyx_view_ == theApp()->currentView())
return;
stopBlinkingCursor();