From 98e317ef1db05e521affdb17aa8b399bfcb9d9d5 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 28 Mar 2011 20:25:35 +0000 Subject: [PATCH] Improve conversion error message. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38098 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/CutAndPaste.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 99f8383e6b..fb7ad88b5a 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -672,13 +672,19 @@ void switchBetweenClasses(DocumentClass const * const oldone, 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."), + it->name(), oldname); + else + s = bformat(_("Flex inset %1$s is undefined because of " + "conversion from `%2$s' layout to `%3$s'."), + it->name(), oldname, newname); // To warn the user that something had to be done. errorlist.push_back(ErrorItem( _("Undefined flex inset"),