From: Tommaso Cucinotta Date: Fri, 27 May 2011 21:54:23 +0000 (+0000) Subject: We use the main document's buffer() instead of the current buffer(), so as to catch... X-Git-Tag: 2.1.0beta1~3165 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e410730dd9b631a88b2283276e718275ac3f1629;p=features.git We use the main document's buffer() instead of the current buffer(), so as to catch the citations defined there, also while using the dialog from the Adv F&R WAs. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38866 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 092470f994..e219390fbd 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -367,7 +367,7 @@ void GuiCitation::updateInfo(BiblioInfo const & bi, QModelIndex const & idx) } QString const keytxt = toqstr( - bi.getInfo(qstring_to_ucs4(idx.data().toString()), buffer(), true)); + bi.getInfo(qstring_to_ucs4(idx.data().toString()), documentBuffer(), true)); infoML->document()->setHtml(keytxt); } @@ -613,7 +613,7 @@ void GuiCitation::findKey(BiblioInfo const & bi, QStringList GuiCitation::citationStyles(BiblioInfo const & bi, int sel) { docstring const key = qstring_to_ucs4(cited_keys_[sel]); - return to_qstring_list(bi.getCiteStrings(key, buffer())); + return to_qstring_list(bi.getCiteStrings(key, documentBuffer())); } @@ -663,7 +663,7 @@ void GuiCitation::filterByEntryType(BiblioInfo const & bi, CiteEngine GuiCitation::citeEngine() const { - return buffer().params().citeEngine(); + return documentBuffer().params().citeEngine(); } @@ -758,21 +758,12 @@ void GuiCitation::dispatchParams() BiblioInfo const & GuiCitation::bibInfo() const { - Buffer const & buf = buffer(); + Buffer const & buf = documentBuffer(); buf.reloadBibInfoCache(); return buf.masterBibInfo(); } -Buffer const & GuiCitation::buffer() const -{ - if (lyxview().documentBufferView()) - return lyxview().documentBufferView()->buffer(); - else - return lyxview().currentBufferView()->buffer(); -} - - void GuiCitation::saveSession() const { Dialog::saveSession(); diff --git a/src/frontends/qt4/GuiCitation.h b/src/frontends/qt4/GuiCitation.h index 8746a1aa65..27f69e56bc 100644 --- a/src/frontends/qt4/GuiCitation.h +++ b/src/frontends/qt4/GuiCitation.h @@ -42,9 +42,6 @@ public: GuiCitation(GuiView & lv); /// ~GuiCitation(); - /// We use the main document's buffer() so to catch the citations - /// defined there, also while using the dialog from the Adv F&R. - Buffer const & buffer() const; private Q_SLOTS: void on_okPB_clicked();