]> git.lyx.org Git - features.git/commitdiff
Fix crash on first load with mouse wheel: this was because the scrollbar was not...
authorAbdelrazak Younes <younes@lyx.org>
Wed, 22 Aug 2007 08:48:01 +0000 (08:48 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 22 Aug 2007 08:48:01 +0000 (08:48 +0000)
* 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

src/frontends/LyXView.cpp
src/frontends/qt4/GuiView.cpp

index 71b8471d490b24e28935f48011c798e4aa81f14d..a5bf70a1f6a9e5c90d33acf47d7a8bb18037f314 100644 (file)
@@ -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());
index 60bc88455f7f3a044bb7245616b5b04765c09bad..986db386b90b8982081b5bec1956dca5960522e5 100644 (file)
@@ -892,7 +892,12 @@ void GuiView::setCurrentWorkArea(WorkArea * work_area)
 
        GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(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();
 }