]> git.lyx.org Git - lyx.git/commitdiff
add some assertion for C-style table access.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 2 Nov 2007 16:43:24 +0000 (16:43 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 2 Nov 2007 16:43:24 +0000 (16:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21379 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiFontLoader.h

index eeae2903ebced622998a32f6ef6fd885d526112a..4ca34b92daa8d413ee4c2129632fabe6144769be 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <QFont>
 
+#include <boost/assert.hpp>
 #include <boost/scoped_ptr.hpp>
 
 namespace lyx {
@@ -67,6 +68,10 @@ public:
 
        /// Get font info (font + metrics) for the given LyX font.
        GuiFontInfo & fontinfo(FontInfo const & f) {
+               BOOST_ASSERT(f.family() < NUM_FAMILIES);
+               BOOST_ASSERT(f.series() < 2);
+               BOOST_ASSERT(f.realShape() < 4);
+               BOOST_ASSERT(f.size() < 10);
                // fi is a reference to the pointer type (GuiFontInfo *) in the
                // fontinfo_ table.
                GuiFontInfo * & fi =