From 11e18212846a6cd98dc6b6ace707c67780b9ee4f Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 10 Jul 2008 12:44:50 +0000 Subject: [PATCH] Fix crash when tab group is closed while Outline is opened. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25537 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 6ddf0f33ae..b15c42bd45 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1273,8 +1273,12 @@ void GuiView::openDocument(string const & fname) dlg.setButton2(qt_("Examples|#E#e"), toqstr(addPath(package().system_support().absFilename(), "examples"))); + QStringList filter(qt_("LyX Documents (*.lyx)")); + filter << qt_("LyX-1.3.x Documents (*.lyx13)") + << qt_("LyX-1.4.x Documents (*.lyx14)") + << qt_("LyX-1.5.x Documents (*.lyx15)"); FileDialog::Result result = - dlg.open(toqstr(initpath), QStringList(qt_("LyX Documents (*.lyx)"))); + dlg.open(toqstr(initpath), filter); if (result.first == FileDialog::Later) return; @@ -1960,7 +1964,13 @@ bool GuiView::dispatch(FuncRequest const & cmd) delete twa; twa = d.currentTabWorkArea(); // Switch to the next GuiWorkArea in the found TabWorkArea. - d.current_work_area_ = twa? twa->currentWorkArea() : 0; + if (twa) { + d.current_work_area_ = twa->currentWorkArea(); + // Make sure the work area is up to date. + twa->setCurrentWorkArea(d.current_work_area_); + } else { + d.current_work_area_ = 0; + } if (d.splitter_->count() == 0) // No more work area, switch to the background widget. d.setBackground();