]> git.lyx.org Git - features.git/commitdiff
Reset counters before we re-run updateBuffer when the bibfiles change.
authorRichard Heck <rikiheck@lyx.org>
Fri, 20 Apr 2018 02:12:44 +0000 (22:12 -0400)
committerRichard Heck <rikiheck@lyx.org>
Sat, 21 Apr 2018 02:58:29 +0000 (22:58 -0400)
Fixes a bug reported by Pavel here:
  https://marc.info/?l=lyx-devel&m=152407889727665&w=2

src/Buffer.cpp

index 97ecd4df41d52466872176e49c5f66ee4e6b6558..7569a4ec128d5404b56f656f7137d4c778508388 100644 (file)
@@ -4801,10 +4801,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);