void setCaptionLabels(Inset & inset, string const & type,
docstring const label, Counters & counters)
{
- LyXText * text = inset.getText(0);
+ Text * text = inset.getText(0);
if (!text)
return;
Inset & inset = *it->inset;
if (inset.lyxCode() == Inset::FLOAT_CODE
|| inset.lyxCode() == Inset::WRAP_CODE) {
- docstring const & name = inset.insetName();
+ docstring const name = inset.name();
if (name.empty())
continue;
// FIXME: are "table" and "Table" the correct type and label?
setCaptionLabels(inset, "table", from_ascii("Table"), counters);
}
+ else if (inset.lyxCode() == Inset::LISTINGS_CODE)
+ setCaptionLabels(inset, "listing", from_ascii("Listing"), counters);
+ else if (inset.lyxCode() == Inset::INCLUDE_CODE)
+ // if this include inset contains lstinputlisting, and has a caption
+ // it will increase the 'listing' counter by one
+ static_cast<InsetInclude &>(inset).updateCounter(counters);
}
}
break;
}
}
- // FIXME Can insetName() return an empty name for wide or
+ // FIXME Can Inset::name() return an empty name for wide or
// float insets? If not we can put the definition of type
// inside the if (in) clause and use that instead of
// if (!type.empty()).
docstring type;
if (in)
- type = in->insetName();
+ type = in->name();
if (!type.empty()) {
Floating const & fl = textclass.floats().getType(to_ascii(type));
if (it == par_iterator_end(buf.inset()))
return false;
-// if (it.lastpit == 0 && LyXText::isMainText(buf))
+// if (it.lastpit == 0 && Text::isMainText(buf))
// return false;
switch (it->layout()->labeltype) {
Buffer & cbuf = const_cast<Buffer &>(buf);
cbuf.tocBackend().update();
- cbuf.structureChanged();
+ if (!childonly)
+ cbuf.structureChanged();
}
{
if (par_it->layout()->labeltype == LABEL_COUNTER
&& par_it->layout()->toclevel != Layout::NOT_IN_TOC) {
- buffer.tocBackend().updateItem(par_it);
- buffer.structureChanged();
+ Buffer * master = buffer.getMasterBuffer();
+ master->tocBackend().updateItem(par_it);
+ master->structureChanged();
}
}