X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFlex.cpp;h=44b9b034360b0174bd5a306785c9e117dd4fb466;hb=e30db1e44474ee379bedb0d1c752297541156497;hp=9a0db9a0973d1a0ac5114f7fb78041fec19dcfe0;hpb=39ea8828061f39010204a31714735e8fbca7e36d;p=lyx.git diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index 9a0db9a097..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 @@ -57,14 +58,6 @@ InsetLayout const & InsetFlex::getLayout() const } -bool InsetFlex::resetFontEdit() const -{ - if (getLayout().resetsFont()) - return true; - return InsetCollapsable::resetFontEdit(); -} - - InsetLayout::InsetDecoration InsetFlex::decoration() const { InsetLayout::InsetDecoration const dec = getLayout().decoration(); @@ -74,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); }