+ BufferParams const & bp = buffer().masterBuffer()->params();
+ Counters & cnts = bp.documentClass().counters();
+ if (utype == OutputUpdate) {
+ // the footnote counter is local to this inset
+ cnts.saveLastCounter();
+ }
+
+ intitle_ = false;
+ infloattable_ = false;
+ bool intable = false;
+ if (it.innerInsetOfType(TABULAR_CODE) != 0)
+ intable = true;
+ if (it.innerInsetOfType(FLOAT_CODE) != 0)
+ infloattable_ = intable;
+ for (size_type sl = 0 ; sl < it.depth() ; ++sl) {
+ if (it[sl].text() && it[sl].paragraph().layout().intitle) {
+ intitle_ = true;
+ break;
+ }
+ }
+
+ Language const * lang = it.paragraph().getParLanguage(bp);
+ InsetLayout const & il = getLayout();
+ docstring const & count = il.counter();
+ custom_label_ = translateIfPossible(il.labelstring());
+ if (cnts.hasCounter(count))
+ cnts.step(count, utype);
+ custom_label_ += ' ' + cnts.theCounter(count, lang->code());
+ setLabel(custom_label_);
+
+ InsetCollapsible::updateBuffer(it, utype);
+ if (utype == OutputUpdate)
+ cnts.restoreLastCounter();