]> git.lyx.org Git - lyx.git/commitdiff
Fix minor bug involving overlapping citation strings.
authorRichard Heck <rgheck@comcast.net>
Tue, 22 May 2007 15:20:19 +0000 (15:20 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 22 May 2007 15:20:19 +0000 (15:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18455 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QCitationDialog.cpp

index b7ace68297956985f68be0417d65b46665c16836..159d666af1a24e475aac02211b6136dbaf8deb80 100644 (file)
@@ -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);
 }