* GuiSpellchecker.cpp:

- prevent null pointer (bug 6586)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33743 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2010-03-15 10:03:02 +00:00
parent 44bb53b57a
commit c23fe9abfe

View File

@ -108,11 +108,14 @@ bool GuiSpellchecker::eventFilter(QObject *obj, QEvent *event)
if (obj == d->ui.suggestionsLW && event->type() == QEvent::KeyPress) {
QKeyEvent *e = static_cast<QKeyEvent *> (event);
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
on_suggestionsLW_itemClicked(d->ui.suggestionsLW->currentItem());
on_replacePB_clicked();
if (d->ui.suggestionsLW->currentItem()) {
on_suggestionsLW_itemClicked(d->ui.suggestionsLW->currentItem());
on_replacePB_clicked();
}
return true;
} else if (e->key() == Qt::Key_Right) {
on_suggestionsLW_itemClicked(d->ui.suggestionsLW->currentItem());
if (d->ui.suggestionsLW->currentItem())
on_suggestionsLW_itemClicked(d->ui.suggestionsLW->currentItem());
return true;
}
}