From 7dcd1a7f4ec74525fd32dafe4f581ee95c0ea26c Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 19 Apr 2018 22:12:44 -0400 Subject: [PATCH] Reset counters before we re-run updateBuffer when the bibfiles change. Fixes a bug reported by Pavel here: https://marc.info/?l=lyx-devel&m=152407889727665&w=2 (cherry picked from commit 64acc06b919e08001cb8ff8d5b69e0902176fe35) --- src/Buffer.cpp | 10 +++++++++- status.23x | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 4d9973a89c..d3e7e6b465 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -4799,10 +4799,18 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const // labels. Nothing else will have changed. So we could create a new // UpdateType that would signal that fact, if we needed to do so. parit = cbuf.par_iterator_begin(); + // we will be re-doing the counters and references and such. + textclass.counters().reset(); + clearReferenceCache(); + // we should not need to do this again? + // updateMacros(); + setChangesPresent(false); updateBuffer(parit, utype); } - else + else { + // this is also set to true on the other path, by reloadBibInfoCache. d->bibinfo_cache_valid_ = true; + } d->cite_labels_valid_ = true; /// FIXME: Perf cbuf.tocBackend().update(true, utype); diff --git a/status.23x b/status.23x index 26a71a3cc7..fbd0357978 100644 --- a/status.23x +++ b/status.23x @@ -210,6 +210,8 @@ What's new - Allow for spaces in bibliography keys (bug 9847). +- Fix weird bug with counters when reloading with emergency file. + * INTERNALS -- 2.39.5