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.
InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p)
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 */)
ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
void InsetCitation::doDispatch(Cursor & cur, FuncRequest & 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;
cache.recalculate = true;
InsetCommand::doDispatch(cur, cmd);
}
InsetCommand::doDispatch(cur, cmd);
}
public:
///
InsetCitation(Buffer * buf, InsetCommandParams const &);
public:
///
InsetCitation(Buffer * buf, InsetCommandParams const &);
+ ///
+ ~InsetCitation();
/// \name Public functions inherited from Inset class
//@{
/// \name Public functions inherited from Inset class
//@{