+ // Do not add this local TextClass to classlist_ if it has
+ // already been loaded by, for example, a master buffer.
+ pair<bool, lyx::textclass_type> pp =
+ textclasslist.numberOfClass(textclass);
+ // only layouts from the same directory are considered to be identical.
+ if (pp.first && classlist_[pp.second].description() == tmpl.description())
+ return pp;