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
This commit is contained in:
Abdelrazak Younes 2007-08-22 08:48:01 +00:00
parent 2419c80657
commit 13a2812c22
2 changed files with 7 additions and 7 deletions

View 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());

View File

@ -892,7 +892,12 @@ void GuiView::setCurrentWorkArea(WorkArea * work_area)
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(work_area);
BOOST_ASSERT(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();
}