+Layout const & TextClass::operator[](docstring const & name) const
+{
+ BOOST_ASSERT(!name.empty());
+
+ const_iterator it =
+ find_if(begin(), end(), LayoutNamesEqual(name));
+
+ if (it == end()) {
+ lyxerr << "We failed to find the layout '" << to_utf8(name)
+ << "' in the layout list. You MUST investigate!"
+ << endl;
+ for (const_iterator cit = begin(); cit != end(); ++cit)
+ lyxerr << " " << to_utf8(cit->name()) << endl;
+
+ // we require the name to exist
+ BOOST_ASSERT(false);
+ }
+
+ return *it;
+}
+
+
+Layout & TextClass::operator[](docstring const & name)