mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Use the main document's buffer(), when scanning for citations from within the citation dialog.
> This allows to pick and search for citations present in the main document. > > This was started to be discussed in a relatively unrelated bug #7581, then the patch > was proposed here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg169277.html git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@38849 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0fcd94beec
commit
b7532cd3b3
@ -20,6 +20,7 @@
|
||||
#include "qt_helpers.h"
|
||||
|
||||
#include "Buffer.h"
|
||||
#include "BufferView.h"
|
||||
#include "BiblioInfo.h"
|
||||
#include "BufferParams.h"
|
||||
#include "FuncRequest.h"
|
||||
@ -625,7 +626,7 @@ void GuiCitation::setCitedKeys()
|
||||
bool GuiCitation::initialiseParams(string const & data)
|
||||
{
|
||||
InsetCommand::string2params(data, params_);
|
||||
CiteEngine const engine = buffer().params().citeEngine();
|
||||
CiteEngine const engine = citeEngine();
|
||||
citeStyles_ = citeStyles(engine);
|
||||
init();
|
||||
return true;
|
||||
@ -763,6 +764,15 @@ BiblioInfo const & GuiCitation::bibInfo() const
|
||||
}
|
||||
|
||||
|
||||
Buffer const & GuiCitation::buffer() const
|
||||
{
|
||||
if (lyxview().documentBufferView())
|
||||
return lyxview().documentBufferView()->buffer();
|
||||
else
|
||||
return lyxview().currentBufferView()->buffer();
|
||||
}
|
||||
|
||||
|
||||
void GuiCitation::saveSession() const
|
||||
{
|
||||
Dialog::saveSession();
|
||||
|
@ -42,6 +42,9 @@ 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();
|
||||
|
Loading…
Reference in New Issue
Block a user