+ xs << full_label_ << ' ';
+ InsetText::XHTMLOptions const opts =
+ InsetText::WriteLabel | InsetText::WriteInnerTag;
+ return InsetText::insetAsXHTML(xs, runparams, opts);
+}
+
+
+void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype)
+{
+ Buffer const & master = *buffer().masterBuffer();
+ DocumentClass const & tclass = master.params().documentClass();
+ string const & lang = it.paragraph().getParLanguage(master.params())->code();
+ Counters & cnts = tclass.counters();
+ string const & type = cnts.current_float();
+ if (utype == OutputUpdate) {
+ // counters are local to the caption
+ cnts.saveLastCounter();
+ }
+ // Memorize type for addToToc().
+ type_ = type;
+ if (type.empty())
+ full_label_ = master.B_("Senseless!!! ");
+ else {
+ // FIXME: life would be _much_ simpler if listings was
+ // listed in Floating.
+ docstring name;
+ if (type == "listing")
+ name = master.B_("Listing");
+ else
+ name = master.B_(tclass.floats().getType(type).name());
+ docstring counter = from_utf8(type);
+ if (cnts.isSubfloat()) {
+ counter = "sub-" + from_utf8(type);
+ name = bformat(_("Sub-%1$s"),
+ master.B_(tclass.floats().getType(type).name()));
+ }
+ if (cnts.hasCounter(counter)) {
+ cnts.step(counter, utype);
+ full_label_ = bformat(from_ascii("%1$s %2$s:"),
+ name,
+ cnts.theCounter(counter, lang));
+ } else
+ full_label_ = bformat(from_ascii("%1$s #:"), name);
+ }
+
+ // Do the real work now.
+ InsetText::updateBuffer(it, utype);
+ if (utype == OutputUpdate)
+ cnts.restoreLastCounter();