]> git.lyx.org Git - lyx.git/commitdiff
Fix crash noticed by Bennett:
authorAbdelrazak Younes <younes@lyx.org>
Wed, 30 Sep 2009 14:30:16 +0000 (14:30 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 30 Sep 2009 14:30:16 +0000 (14:30 +0000)
Open new document; LyX > Preferences; change
anything; click on "Save" button --> Crash. Backtrace is below.

Once again, this does not happen when no document is open.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31486 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/Menus.cpp

index 978228f70a6d85784bb7d0e79af9da9954f2a4e8..6b0a78adaaa693a76bc20c5eda488552de9cd68b 100644 (file)
@@ -1026,6 +1026,7 @@ void GuiApplication::resetGui()
        QHash<int, GuiView *>::iterator it;
        for (it = d->views_.begin(); it != d->views_.end(); ++it) {
                GuiView * gv = *it;
+               setCurrentView(gv);
                gv->setLayoutDirection(layoutDirection());
                gv->resetDialogs();
        }
index b1e06fc00d31a3b348c18623addba10012aef534..c916fb8bf6efc66a026a08f4048e4ae6831106a4 100644 (file)
@@ -781,7 +781,8 @@ void MenuDefinition::expandDocuments()
                        QString label = toqstr(b->fileName().displayName(20));
                        if (!b->isClean())
                                label += "*";
-                       bool const shown = guiApp->currentView()->workArea(*b);
+                       bool const shown = guiApp->currentView()
+                                          ? guiApp->currentView()->workArea(*b) : false;
                        int ii = shown ? vis : invis;
                        if (ii < 10)
                                label = QString::number(ii) + ". " + label + '|' + QString::number(ii);