- setCounter(buf, it);
- }
-}
-
-
-string expandLabel(Buffer const & buf,
- LyXLayout_ptr const & layout, bool appendix)
-{
- LyXTextClass const & tclass = buf.params().getLyXTextClass();
-
- string fmt = buf.B_(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 != string::npos) {
- size_t const j = fmt.find('@', i + 1);
- if (j != string::npos) {
- string parent(fmt, i + 1, j - i - 1);
- string label = expandLabel(buf, tclass[parent], appendix);
- fmt = string(fmt, 0, i) + label + string(fmt, j + 1, string::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);