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 101104bf5e
commit 54cbc7f7bb
3 changed files with 17 additions and 2 deletions

View File

@ -45,7 +45,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 */)
@ -104,8 +113,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
//@{

View File

@ -98,6 +98,8 @@ What's new
- Use document language when exporting citations to LyXHTML (bug 7732).
- Reordering citations in LyX is now rendered in the output (bug 6955).
- Fix InsetLayout's LatexParam output: \begin{inset}[latexparam].