- 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();
- docstring const s = bformat(_(
- "Character style %1$s is "
- "undefined because of class "
- "conversion from\n%2$s to %3$s"),
- from_utf8(name), from_utf8(tclass1.name()),
- from_utf8(tclass2.name()));
- // To warn the user that something had to be done.
- errorlist.push_back(ErrorItem(
- _("Undefined character style"),
- s, it.paragraph().id(), it.pos(), it.pos() + 1));
- } else if (inset.undefined()) {
- // The character style is undefined in
- // tclass1 and is defined in tclass2
- inset.setDefined(found_cs);
- }
- }
+ InsetCollapsable * inset = it->asInsetCollapsable();
+ if (!inset)
+ continue;
+ if (inset->lyxCode() != FLEX_CODE)
+ // FIXME: Should we verify all InsetCollapsable?
+ continue;
+ inset->setLayout(newone);
+ if (!inset->undefined())
+ continue;
+ // The flex inset is undefined in newtc
+ docstring const s = bformat(_(
+ "Flex inset %1$s is "
+ "undefined because of class "
+ "conversion from\n%2$s to %3$s"),
+ inset->name(), from_utf8(oldtc.name()),
+ from_utf8(newtc.name()));
+ // To warn the user that something had to be done.
+ errorlist.push_back(ErrorItem(
+ _("Undefined flex inset"),
+ s, it.paragraph().id(), it.pos(), it.pos() + 1));