- if (it->lyxCode() == Inset::CHARSTYLE_CODE) {
- InsetCharStyle & inset =
- static_cast<InsetCharStyle &>(*it);
- string const name = inset.params().type;
- CharStyles::iterator const found_cs =
- tclass2.charstyle(name);
- if (found_cs == tclass2.charstyles().end()) {
- // The character style is undefined in tclass2
- inset.setUndefined();
+ if (it->lyxCode() == FLEX_CODE) {
+ InsetFlex & inset =
+ static_cast<InsetFlex &>(*it);
+ string const name = inset.params().name;
+ InsetLayout const il =
+ tclass2.insetlayout(from_utf8(name));
+ inset.setLayout(il);
+ if (il.labelstring == from_utf8("UNDEFINED")) {
+ // The flex inset is undefined in tclass2