add some assertion for C-style table access.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21379 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-11-02 16:43:24 +00:00
parent b931f6ab4a
commit 876d88a86e

View 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 =