From 25d50ae7f9d78d16d8feeddfea3b8e3c0bfb5c33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 1 Oct 2003 16:27:36 +0000 Subject: [PATCH] assert on unknown insets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7847 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/factory.C | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a0b99b6e16..672fa8715f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ + +2003-10-01 André Pönitz + + * factory.C: assert early + 2003-09-26 Lars Gullik Bjønnes * lyx_main.C: remove the glboal debug object diff --git a/src/factory.C b/src/factory.C index 4eabc25c46..1eb5e163bd 100644 --- a/src/factory.C +++ b/src/factory.C @@ -55,6 +55,8 @@ #include "support/lstrings.h" #include "support/std_sstream.h" +#include + using lyx::support::compare_ascii_no_case; using std::endl; @@ -354,6 +356,9 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf) inset = new InsetFloatList("table"); } else if (cmdName == "printindex") { inset = new InsetPrintIndex(inscmd); + } else { + lyxerr << "unknown CommandInset '" << cmdName << "'" << std::endl; + BOOST_ASSERT(false); } } else { if (tmptok == "Quotes") { @@ -411,10 +416,12 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf) inset = new InsetCaption(buf.params()); } else if (tmptok == "FloatList") { inset = new InsetFloatList; + } else { + lyxerr << "unknown Inset type '" << tmptok << "'" << std::endl; + BOOST_ASSERT(false); } - if (inset) - inset->read(buf, lex); + inset->read(buf, lex); } return inset; -- 2.39.2