X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt2%2FQCitationDialog.C;h=4a188b647c4dbc082203f3b701d5c20635c1dc98;hb=ce044d86c4e9363d6c20f98327ce13a90b13d7d7;hp=960363b5afba8bd25e6072918ea64a0cc9ad1fb9;hpb=51de4d6b818066b5f4f7fb8985649e43e8c16497;p=lyx.git diff --git a/src/frontends/qt2/QCitationDialog.C b/src/frontends/qt2/QCitationDialog.C index 960363b5af..4a188b647c 100644 --- a/src/frontends/qt2/QCitationDialog.C +++ b/src/frontends/qt2/QCitationDialog.C @@ -132,9 +132,17 @@ void QCitationDialog::addCitation() if (sel < 0) return; - // Add the selected browser_bib key to browser_cite - selectedLB->insertItem(toqstr(form_->bibkeys[sel])); - form_->citekeys.push_back(form_->bibkeys[sel]); + // Add the selected browser_bib keys to browser_cite + // multiple selections are possible + for (unsigned int i = 0; i != add_->availableLB->count(); i++) { + if (add_->availableLB->isSelected(i)) { + // do not allow duplicates + if ((selectedLB->findItem(add_->availableLB->text(i))) == 0) { + selectedLB->insertItem(toqstr(form_->bibkeys[i])); + form_->citekeys.push_back(form_->bibkeys[i]); + } + } + } int const n = int(form_->citekeys.size()); selectedLB->setSelected(n - 1, true);