From f365a650686cc27487f686a7803968df1f24e0b8 Mon Sep 17 00:00:00 2001 From: Guillaume MM Date: Tue, 16 May 2017 12:14:25 +0200 Subject: [PATCH] Fix the computation of broken InsetRef status between sibling documents --- src/Buffer.cpp | 11 ++++++----- src/insets/InsetInclude.cpp | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 239bacd064..9f6b20f7b7 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -4763,16 +4763,17 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const ParIterator parit = cbuf.par_iterator_begin(); updateBuffer(parit, utype); - /// FIXME: Perf - /// Update the tocBackend for any buffer. The outliner uses the master's, - /// and the navigation menu uses the child's. - cbuf.tocBackend().update(true, utype); - if (master != this) + // If this document has siblings, then update the TocBackend later. The + // reason is to ensure that later siblings are up to date when e.g. the + // broken or not status of references is computed. The update is called + // in InsetInclude::addToToc. return; d->bibinfo_cache_valid_ = true; d->cite_labels_valid_ = true; + /// FIXME: Perf + cbuf.tocBackend().update(true, utype); if (scope == UpdateMaster) cbuf.structureChanged(); } diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 341115cbb3..06b5238113 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -1167,6 +1167,9 @@ void InsetInclude::addToToc(DocIterator const & cpit, bool output_active, if (!childbuffer) return; + // Update the child's tocBackend. The outliner uses the master's, but + // the navigation menu uses the child's. + childbuffer->tocBackend().update(output_active, utype); // Include Tocs from children childbuffer->inset().addToToc(DocIterator(), output_active, utype, backend); -- 2.39.2