]> git.lyx.org Git - features.git/commitdiff
assert on unknown insets
authorAndré Pönitz <poenitz@gmx.net>
Wed, 1 Oct 2003 16:27:36 +0000 (16:27 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 1 Oct 2003 16:27:36 +0000 (16:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7847 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/factory.C

index a0b99b6e163116f1b8c2ddffc61fd4061b805be0..672fa8715f6f21df6f08cdd9721e6c90163f7c7f 100644 (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 
index 4eabc25c46bce2c5260f3b9d53bae1954f777b94..1eb5e163bd5c5372710f849198108987b99b92d8 100644 (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;