From: André Pönitz Date: Wed, 1 Oct 2003 16:27:36 +0000 (+0000) Subject: assert on unknown insets X-Git-Tag: 1.6.10~16017 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=25d50ae7f9d78d16d8feeddfea3b8e3c0bfb5c33;p=features.git assert on unknown insets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7847 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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;