mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Remove the .aux and .bbl files when we switch the citation engine or style.
This commit is contained in:
parent
e5a40e9616
commit
ab66c18a9d
@ -2052,6 +2052,24 @@ bool Buffer::citeLabelsValid() const
|
||||
}
|
||||
|
||||
|
||||
void Buffer::removeBiblioTempFiles() const
|
||||
{
|
||||
// We remove files that contain LaTeX commands specific to the
|
||||
// particular bibliographic style being used, in order to avoid
|
||||
// LaTeX errors when we switch style.
|
||||
FileName const aux_file(addName(temppath(), changeExtension(latexName(),".aux")));
|
||||
FileName const bbl_file(addName(temppath(), changeExtension(latexName(),".bbl")));
|
||||
LYXERR(Debug::FILES, "Removing the .aux file " << aux_file);
|
||||
aux_file.removeFile();
|
||||
LYXERR(Debug::FILES, "Removing the .bbl file " << bbl_file);
|
||||
bbl_file.removeFile();
|
||||
// Also for the parent buffer
|
||||
Buffer const * const pbuf = parent();
|
||||
if (pbuf)
|
||||
pbuf->removeBiblioTempFiles();
|
||||
}
|
||||
|
||||
|
||||
bool Buffer::isDepClean(string const & name) const
|
||||
{
|
||||
DepClean::const_iterator const it = d->dep_clean.find(name);
|
||||
|
@ -475,6 +475,9 @@ public:
|
||||
///
|
||||
void getLabelList(std::vector<docstring> &) const;
|
||||
|
||||
/// This removes the .aux and .bbl files from the temp dir.
|
||||
void removeBiblioTempFiles() const;
|
||||
|
||||
///
|
||||
void changeLanguage(Language const * from, Language const * to);
|
||||
|
||||
|
@ -2214,6 +2214,8 @@ void GuiDocument::applyView()
|
||||
else
|
||||
bp_.bibtex_command = bibtex_command + " " + bibtex_options;
|
||||
|
||||
buffer().removeBiblioTempFiles();
|
||||
|
||||
// Indices
|
||||
indicesModule->apply(bp_);
|
||||
|
||||
|
@ -57,14 +57,17 @@ namespace os = support::os;
|
||||
InsetBibtex::InsetBibtex(Buffer * buf, InsetCommandParams const & p)
|
||||
: InsetCommand(buf, p)
|
||||
{
|
||||
buffer().invalidateBibfileCache();
|
||||
buffer().invalidateBibinfoCache();
|
||||
buffer().removeBiblioTempFiles();
|
||||
}
|
||||
|
||||
|
||||
InsetBibtex::~InsetBibtex()
|
||||
{
|
||||
if (isBufferLoaded())
|
||||
if (isBufferLoaded()) {
|
||||
buffer().invalidateBibfileCache();
|
||||
buffer().removeBiblioTempFiles();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,6 +110,7 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
buffer().invalidateBibfileCache();
|
||||
buffer().removeBiblioTempFiles();
|
||||
cur.forceBufferUpdate();
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user