A very simple patch to fix this bug. OK to commit?

rh

-- 
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: QCitationDialog.cpp
===================================================================
--- QCitationDialog.cpp	(revision 18444)
+++ QCitationDialog.cpp	(working copy)
@@ -258,22 +258,25 @@
 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);
+	//return form_->selected()->stringList().indexOf(QRegExp("^" + str + "$")) >= 0;
 }
 
 
 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);
 }
 
 

Reply via email to