From 51b5c6ae04dffecfbbbd9192f26aa7dcf5c005ff Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 3 Oct 2007 07:17:58 +0000 Subject: [PATCH] Oups... Fix crash on startup... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20681 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 2ce2de6998..c3db0821b4 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -736,14 +736,15 @@ bool GuiViewBase::event(QEvent * e) //case QEvent::Drop: // break; - case QEvent::WindowActivate: { - GuiWorkArea * wa = dynamic_cast(d.tab_widget_->currentWidget()); - BOOST_ASSERT(wa); - BufferView & bv = wa->bufferView(); - connectBufferView(bv); - connectBuffer(bv.buffer()); + case QEvent::WindowActivate: + if (d.tab_widget_->count()) { + GuiWorkArea * wa = dynamic_cast(d.tab_widget_->currentWidget()); + BOOST_ASSERT(wa); + BufferView & bv = wa->bufferView(); + connectBufferView(bv); + connectBuffer(bv.buffer()); + } return QMainWindow::event(e); - } case QEvent::ShortcutOverride: { QKeyEvent * ke = static_cast(e);