X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFlex.cpp;h=44b9b034360b0174bd5a306785c9e117dd4fb466;hb=cfeddb92;hp=70de9fd2ebaeef97cbb5ec8b7ce7fe3721eed0cb;hpb=f47361c4db69c7de87471d15cb0156d2bc0cdda8;p=lyx.git diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index 70de9fd2eb..44b9b03436 100644 --- a/src/insets/InsetFlex.cpp +++ b/src/insets/InsetFlex.cpp @@ -25,6 +25,7 @@ #include "TextClass.h" #include "support/gettext.h" +#include "support/lstrings.h" #include @@ -66,8 +67,20 @@ InsetLayout::InsetDecoration InsetFlex::decoration() const void InsetFlex::write(ostream & os) const { - os << "Flex " << - (name_.empty() ? "undefined" : name_) << "\n"; + os << "Flex "; + InsetLayout const & il = getLayout(); + if (name_.empty()) + os << "undefined"; + else { + // use il.name(), since this resolves obsoleted + // InsetLayout names + string name = to_utf8(il.name()); + // Remove the "Flex:" prefix, if it is present + if (support::prefixIs(name, "Flex:")) + name = support::token(name, ':', 1); + os << name; + } + os << "\n"; InsetCollapsable::write(os); }