Err, this is not exactly what I wrote, is it? > InsetLayout const & TextClass::insetlayout(docstring const & name) const > { > - return insetlayoutlist_[name]; > + docstring n = name; > + while (!n.empty()) { > + if (!insetlayoutlist_.count(n) > 0) > + return insetlayoutlist_[n]; > + docstring::size_type i = n.find(':'); > + if (i == string::npos) > + n = n.substr(0,i); > + } > + static const InsetLayout empty; > + return empty; > }
If you want to follow make Abdel happy, use: if (i == string::npos) break; n = n.substr(0,i); JMarc