+// if (it.lastpit == 0 && LyXText::isMainText(buf))
+// return false;
+
+ switch (it->layout()->labeltype) {
+
+ case LABEL_NO_LABEL:
+ case LABEL_MANUAL:
+ case LABEL_BIBLIO:
+ case LABEL_TOP_ENVIRONMENT:
+ case LABEL_CENTERED_TOP_ENVIRONMENT:
+ case LABEL_STATIC:
+ case LABEL_ITEMIZE:
+ setLabel(buf, it, buf.params().getLyXTextClass());
+ return true;
+
+ case LABEL_SENSITIVE:
+ case LABEL_COUNTER:
+ // do more things with enumerate later
+ case LABEL_ENUMERATE:
+ return false;
+ }
+
+ // This is dead code which get rid of a warning:
+ return true;
+}
+
+
+void updateLabels(Buffer const & buf,
+ ParIterator & from, ParIterator & to, bool childonly)
+{
+ for (ParIterator it = from; it != to; ++it) {
+ if (it.pit() > it.lastpit())
+ return;
+ if (!updateCurrentLabel (buf, it)) {
+ updateLabels(buf, childonly);
+ return;
+ }
+ }
+}
+
+
+void updateLabels(Buffer const & buf, ParIterator & iter, bool childonly)
+{
+ if (updateCurrentLabel(buf, iter))
+ return;
+
+ updateLabels(buf, childonly);
+}
+
+
+void updateLabels(Buffer const & buf, bool childonly)
+{
+ // Use the master text class also for child documents
+ LyXTextClass const & textclass = buf.params().getLyXTextClass();
+
+ if (!childonly) {
+ // If this is a child document start with the master
+ Buffer const * const master = buf.getMasterBuffer();
+ if (master != &buf) {
+ updateLabels(*master);
+ return;
+ }
+
+ // start over the counters
+ textclass.counters().reset();
+ }
+
+ ParIterator const end = par_iterator_end(buf.inset());
+
+ for (ParIterator it = par_iterator_begin(buf.inset()); it != end; ++it) {