Fix the computation of broken InsetRef status between sibling documents

This commit is contained in:
Guillaume MM 2017-05-16 12:14:25 +02:00
parent d7bcab5e27
commit f365a65068
2 changed files with 9 additions and 5 deletions

View File

@ -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();
}

View File

@ -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);