]> git.lyx.org Git - features.git/commitdiff
Fix the computation of broken InsetRef status between sibling documents
authorGuillaume MM <gm@lyx.org>
Tue, 16 May 2017 10:14:25 +0000 (12:14 +0200)
committerGuillaume MM <gm@lyx.org>
Tue, 16 May 2017 10:15:27 +0000 (12:15 +0200)
src/Buffer.cpp
src/insets/InsetInclude.cpp

index 239bacd06425061861b2a7634be2c0554ec7bd0c..9f6b20f7b7da9530178528545eb9f9508660b3d1 100644 (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();
 }
index 341115cbb323eba2bed325684c0805876f2b4bce..06b52381137c1a449bc9ac671d32237a8da95855 100644 (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);