From: Abdelrazak Younes Date: Wed, 22 Aug 2007 08:48:01 +0000 (+0000) Subject: Fix crash on first load with mouse wheel: this was because the scrollbar was not... X-Git-Tag: 1.6.10~8757 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=13a2812c22a94df26e762104aa7c9843806265a0;p=features.git Fix crash on first load with mouse wheel: this was because the scrollbar was not updated. * loadLyXFile::setBuffer(): get rid of a premature optimisation, we make sure that everything is properly drawn in any case. * GuiView::setCurrentWorkArea(): make sure everything is updated if we don't change tab. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19717 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/LyXView.cpp b/src/frontends/LyXView.cpp index 71b8471d49..a5bf70a1f6 100644 --- a/src/frontends/LyXView.cpp +++ b/src/frontends/LyXView.cpp @@ -111,14 +111,9 @@ Buffer const * LyXView::buffer() const void LyXView::setBuffer(Buffer * newBuffer) { + BOOST_ASSERT(newBuffer); busy(true); - Buffer * oldBuffer = buffer(); - if (oldBuffer == newBuffer) { - busy(false); - return; - } - WorkArea * wa = workArea(*newBuffer); if (wa == 0) { updateLabels(*newBuffer->getMasterBuffer()); diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 60bc88455f..986db386b9 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -892,7 +892,12 @@ void GuiView::setCurrentWorkArea(WorkArea * work_area) GuiWorkArea * wa = dynamic_cast(work_area); BOOST_ASSERT(wa); - d.tab_widget_->setCurrentWidget(wa); + if (wa != d.tab_widget_->currentWidget()) + // Switch to the work area. + d.tab_widget_->setCurrentWidget(wa); + else + // Make sure the work area is up to date. + currentTabChanged(d.tab_widget_->currentIndex()); wa->setFocus(); }