]> git.lyx.org Git - features.git/blobdiff - src/buffer_funcs.cpp
move updateLables to buffer
[features.git] / src / buffer_funcs.cpp
index f37a74194515506aa57e1920afe40b1855543f42..9e0350a9ef43d06a65a03c59b24c11f91f44e9dc 100644 (file)
@@ -471,58 +471,4 @@ void updateLabels(Buffer const & buf, ParIterator & parit)
        }
 }
 
-
-// FIXME: buf should should be const because updateLabels() modifies
-// the contents of the paragraphs.
-void updateLabels(Buffer const & buf, bool childonly)
-{
-       // Use the master text class also for child documents
-       Buffer const * const master = buf.masterBuffer();
-       DocumentClass const & textclass = master->params().documentClass();
-
-       // keep the buffers to be children in this set. If the call from the
-       // master comes back we can see which of them were actually seen (i.e.
-       // via an InsetInclude). The remaining ones in the set need still be updated.
-       static std::set<Buffer const *> bufToUpdate;
-       if (!childonly) {
-               // If this is a child document start with the master
-               if (master != &buf) {
-                       bufToUpdate.insert(&buf);
-                       updateLabels(*master);
-
-                       // was buf referenced from the master (i.e. not in bufToUpdate anymore)?
-                       if (bufToUpdate.find(&buf) == bufToUpdate.end())
-                               return;
-               }
-
-               // start over the counters in the master
-               textclass.counters().reset();
-       }
-
-       // update will be done below for buf
-       bufToUpdate.erase(&buf);
-
-       // update all caches
-       buf.clearReferenceCache();
-       buf.inset().setBuffer(const_cast<Buffer &>(buf));
-       buf.updateMacros();
-
-       Buffer & cbuf = const_cast<Buffer &>(buf);
-
-       BOOST_ASSERT(!buf.text().paragraphs().empty());
-
-       // do the real work
-       ParIterator parit = par_iterator_begin(buf.inset());
-       updateLabels(buf, parit);
-
-       if (master != &buf)
-               // TocBackend update will be done later.
-               return;
-
-       cbuf.tocBackend().update();
-       if (!childonly)
-               cbuf.structureChanged();
-}
-
-
 } // namespace lyx