]> git.lyx.org Git - lyx.git/commitdiff
Improve and unify error messages
authorGeorg Baum <baum@lyx.org>
Tue, 9 Dec 2014 20:19:49 +0000 (21:19 +0100)
committerGeorg Baum <baum@lyx.org>
Tue, 9 Dec 2014 20:20:56 +0000 (21:20 +0100)
Now the errors given for an unknown layout in copystyle and obsoletedby provide
the same information.

src/insets/InsetLayout.cpp

index ee415b1b9b6ebbc3ec67af2d95f51d31d228d231..98f9775d8d4252c14afd49c60253c3d4e1ecf827 100644 (file)
@@ -321,7 +321,8 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
                                name_ = tmpname;
                        } else {
                                LYXERR0("Cannot copy unknown InsetLayout `"
-                                       << style << "'\n"
+                                       << style << "' to InsetLayout `"
+                                       << name() << "'\n"
                                        << "All InsetLayouts so far:");
                                TextClass::InsetLayouts::const_iterator lit = 
                                                tclass.insetLayouts().begin();
@@ -348,8 +349,17 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
                                if (obsoleted_by().empty())
                                        obsoleted_by_ = style;
                        } else {
-                               LYXERR0("Cannot replace with unknown InsetLayout `"
-                                       << style << '\'');
+                               LYXERR0("Cannot replace InsetLayout `"
+                                       << name()
+                                       << "' with unknown InsetLayout `"
+                                       << style << "'\n"
+                                       << "All InsetLayouts so far:");
+                               TextClass::InsetLayouts::const_iterator lit = 
+                                               tclass.insetLayouts().begin();
+                               TextClass::InsetLayouts::const_iterator len = 
+                                               tclass.insetLayouts().end();
+                               for (; lit != len; ++lit)
+                                       lyxerr << lit->second.name() << "\n";
                        }
                        break;
                }