Fix crash noticed by Bennett:

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
This commit is contained in:
Abdelrazak Younes 2009-09-30 14:30:16 +00:00
parent da47dc051e
commit 5c2dad7029
2 changed files with 3 additions and 1 deletions

View File

@ -1026,6 +1026,7 @@ void GuiApplication::resetGui()
QHash<int, GuiView *>::iterator it; QHash<int, GuiView *>::iterator it;
for (it = d->views_.begin(); it != d->views_.end(); ++it) { for (it = d->views_.begin(); it != d->views_.end(); ++it) {
GuiView * gv = *it; GuiView * gv = *it;
setCurrentView(gv);
gv->setLayoutDirection(layoutDirection()); gv->setLayoutDirection(layoutDirection());
gv->resetDialogs(); gv->resetDialogs();
} }

View File

@ -781,7 +781,8 @@ void MenuDefinition::expandDocuments()
QString label = toqstr(b->fileName().displayName(20)); QString label = toqstr(b->fileName().displayName(20));
if (!b->isClean()) if (!b->isClean())
label += "*"; label += "*";
bool const shown = guiApp->currentView()->workArea(*b); bool const shown = guiApp->currentView()
? guiApp->currentView()->workArea(*b) : false;
int ii = shown ? vis : invis; int ii = shown ? vis : invis;
if (ii < 10) if (ii < 10)
label = QString::number(ii) + ". " + label + '|' + QString::number(ii); label = QString::number(ii) + ". " + label + '|' + QString::number(ii);