]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
Substack support for XHTML.
[lyx.git] / src / CutAndPaste.cpp
index 99f8383e6b027abf14a4fa222942e182cb34ccf8..39b732fea6b2affdec2d3ab6d800c9b1bb010fe3 100644 (file)
@@ -667,18 +667,25 @@ void switchBetweenClasses(DocumentClass const * const oldone,
                if (it->lyxCode() != FLEX_CODE)
                        // FIXME: Should we verify all InsetCollapsable?
                        continue;
-               docstring const & n = newone->insetLayout(it->name()).name();
+
+               docstring const layoutName = it->layoutName();
+               docstring const & n = newone->insetLayout(layoutName).name();
                bool const is_undefined = n.empty() ||
                        n == DocumentClass::plainInsetLayout().name();
                if (!is_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"),
-                       it->name(), from_utf8(oldtc.name()),
-                       from_utf8(newtc.name()));
+               docstring const oldname = from_utf8(oldtc.name());
+               docstring const newname = from_utf8(newtc.name());
+               docstring s;
+               if (oldname == newname)
+                       s = bformat(_("Flex inset %1$s is undefined after "
+                               "reloading `%2$s' layout."), layoutName, oldname);
+               else
+                       s = bformat(_("Flex inset %1$s is undefined because of "
+                               "conversion from `%2$s' layout to `%3$s'."),
+                               layoutName, oldname, newname);
                // To warn the user that something had to be done.
                errorlist.push_back(ErrorItem(
                                _("Undefined flex inset"),