From 559c84c370514403235ef94f7879a2e9185d8857 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 11 Dec 2003 14:42:39 +0000 Subject: [PATCH] Prevent an assert when opening the citation dialog if the bibtex database is not found. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8232 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 6 ++++++ src/frontends/qt2/QCitationDialog.C | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 8c49a2efc2..ee137afebc 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,9 @@ +2003-12-11 Angus Leeming + + * QCitationDialog.C (availableChanged, selectedChanged): ensure that + the bibkeysInfo map is populated before calling biblio::getInfo. + Prevents and assert when the bibtex database is not found. + 2003-12-10 Angus Leeming * QExternal.C, ui/QExternalDialogBase.ui: add a 'draft' check box diff --git a/src/frontends/qt2/QCitationDialog.C b/src/frontends/qt2/QCitationDialog.C index 42a7bb766c..d5be3d1b1c 100644 --- a/src/frontends/qt2/QCitationDialog.C +++ b/src/frontends/qt2/QCitationDialog.C @@ -83,7 +83,9 @@ void QCitationDialog::selectedChanged() return; } - infoML->setText(toqstr(biblio::getInfo(theMap, form_->citekeys[sel]))); + if (!theMap.empty()) + infoML->setText( + toqstr(biblio::getInfo(theMap, form_->citekeys[sel]))); setButtons(); } @@ -111,7 +113,9 @@ void QCitationDialog::availableChanged() return; } - add_->infoML->setText(toqstr(biblio::getInfo(theMap, form_->bibkeys[sel]))); + if (!theMap.empty()) + add_->infoML->setText( + toqstr(biblio::getInfo(theMap, form_->bibkeys[sel]))); setButtons(); }