Force BibTeX rerun upon add/remove/change citation (fixes #6955).

Reordering citations is one case where catching "Citation undefined
on page ..." doesn't catch the need for a bibtex rerun. This patch
ensures the proper ordering is obtained in pdf output without having
to resort to closing and reopening the LyX document.
This commit is contained in:
Julien Rioux 2013-01-12 01:04:07 +01:00
parent 26b67dcb49
commit 2ffd130d2b
2 changed files with 15 additions and 2 deletions

View File

@ -44,7 +44,16 @@ ParamInfo InsetCitation::param_info_;
InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p)
{}
{
buffer().removeBiblioTempFiles();
}
InsetCitation::~InsetCitation()
{
if (isBufferLoaded())
buffer().removeBiblioTempFiles();
}
ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
@ -105,8 +114,10 @@ bool InsetCitation::isCompatibleCommand(string const & cmd)
void InsetCitation::doDispatch(Cursor & cur, FuncRequest & cmd)
{
if (cmd.action() == LFUN_INSET_MODIFY)
if (cmd.action() == LFUN_INSET_MODIFY) {
buffer().removeBiblioTempFiles();
cache.recalculate = true;
}
InsetCommand::doDispatch(cur, cmd);
}

View File

@ -31,6 +31,8 @@ class InsetCitation : public InsetCommand
public:
///
InsetCitation(Buffer * buf, InsetCommandParams const &);
///
~InsetCitation();
/// \name Public functions inherited from Inset class
//@{