- setLabel(buf, it);
- }
-
- const_cast<Buffer &>(buf).tocBackend().update();
-}
-
-
-docstring expandLabel(Buffer const & buf,
- LyXLayout_ptr const & layout, bool appendix)
-{
- LyXTextClass const & tclass = buf.params().getLyXTextClass();
-
- // FIXME UNICODE
- docstring fmt = buf.B_(to_ascii(appendix ? layout->labelstring_appendix()
- : layout->labelstring()));
-
- // handle 'inherited level parts' in 'fmt',
- // i.e. the stuff between '@' in '@Section@.\arabic{subsection}'
- size_t const i = fmt.find('@', 0);
- if (i != docstring::npos) {
- size_t const j = fmt.find('@', i + 1);
- if (j != docstring::npos) {
- docstring parent(fmt, i + 1, j - i - 1);
- // FIXME UNICODE
- docstring label = expandLabel(buf, tclass[to_utf8(parent)], appendix);
- fmt = docstring(fmt, 0, i) + label + docstring(fmt, j + 1, docstring::npos);
+ setLabel(buf, it, textclass);
+
+ // Now included docs
+ InsetList::const_iterator iit = it->insetlist.begin();
+ InsetList::const_iterator end = it->insetlist.end();
+ for (; iit != end; ++iit) {
+ if (iit->inset->lyxCode() == InsetBase::INCLUDE_CODE)
+ static_cast<InsetInclude const *>(iit->inset)
+ ->updateLabels(buf);