]> git.lyx.org Git - features.git/blobdiff - src/buffer_funcs.cpp
move updateLables to buffer
[features.git] / src / buffer_funcs.cpp
index ed841f235cbc9cc90ce6fb05f98e06c7874627a5..9e0350a9ef43d06a65a03c59b24c11f91f44e9dc 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Alfredo Braunstein
  *
  * Full author contact details are available in file CREDITS.
@@ -466,50 +466,9 @@ void updateLabels(Buffer const & buf, ParIterator & parit)
                InsetList::const_iterator end = parit->insetList().end();
                for (; iit != end; ++iit) {
                        parit.pos() = iit->pos;
-                       iit->inset->setBuffer(const_cast<Buffer &>(buf));
                        iit->inset->updateLabels(parit);
                }
        }
 }
 
-
-// FIXME: buf should should be const because updateLabels() modifies
-// the contents of the paragraphs.
-void updateLabels(Buffer const & buf, bool childonly)
-{
-       Buffer const * const master = buf.masterBuffer();
-       // Use the master text class also for child documents
-       DocumentClass const & textclass = master->params().documentClass();
-
-       if (!childonly) {
-               // If this is a child document start with the master
-               if (master != &buf) {
-                       updateLabels(*master);
-                       return;
-               }
-
-               // start over the counters
-               textclass.counters().reset();
-               buf.clearReferenceCache();
-               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