From: Richard Heck Date: Tue, 22 May 2007 15:20:19 +0000 (+0000) Subject: Fix minor bug involving overlapping citation strings. X-Git-Tag: 1.6.10~9669 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9ad89851499e43f8d0f6138b23331780be9c002f;hp=a9a3b79528d4476cf7a5a3b3cdc79340e8acaa29;p=lyx.git Fix minor bug involving overlapping citation strings. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18455 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/QCitationDialog.cpp b/src/frontends/qt4/QCitationDialog.cpp index b7ace68297..159d666af1 100644 --- a/src/frontends/qt4/QCitationDialog.cpp +++ b/src/frontends/qt4/QCitationDialog.cpp @@ -258,22 +258,24 @@ void QCitationDialog::fillStyles() bool QCitationDialog::isSelected(const QModelIndex & idx) { QString const str = idx.data().toString(); - return !form_->selected()->stringList().filter(str).isEmpty(); + return form_->selected()->stringList().contains(str); } void QCitationDialog::setButtons() { int const arows = availableLV->model()->rowCount(); - addPB->setEnabled(arows>0 && !isSelected(availableLV->currentIndex())); + addPB->setEnabled(arows > 0 && + availableLV->currentIndex().isValid() && + !isSelected(availableLV->currentIndex())); int const srows = selectedLV->model()->rowCount(); int const sel_nr = selectedLV->currentIndex().row(); deletePB->setEnabled(sel_nr >= 0); upPB->setEnabled(sel_nr > 0); downPB->setEnabled(sel_nr >= 0 && sel_nr < srows - 1); - applyPB->setEnabled(srows>0); - okPB->setEnabled(srows>0); + applyPB->setEnabled(srows > 0); + okPB->setEnabled(srows > 0); }