assert on unknown insets

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7847 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-10-01 16:27:36 +00:00
parent 06be7f6c0b
commit 25d50ae7f9
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2003-10-01 André Pönitz <poenitz@gmx.net>
* factory.C: assert early
2003-09-26 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyx_main.C: remove the glboal debug object

View File

@ -55,6 +55,8 @@
#include "support/lstrings.h"
#include "support/std_sstream.h"
#include <boost/assert.hpp>
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;