From 9ad89851499e43f8d0f6138b23331780be9c002f Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 22 May 2007 15:20:19 +0000 Subject: [PATCH 1/1] Fix minor bug involving overlapping citation strings. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18455 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QCitationDialog.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } -- 2.39.2