]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiFontLoader.h
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiFontLoader.h
index eeae2903ebced622998a32f6ef6fd885d526112a..b48bfd4cfd18351dd84d92c4d2b59304ac2c69cf 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QFont>
 
-#include <boost/scoped_ptr.hpp>
+#include <boost/assert.hpp>
 
 namespace lyx {
 namespace frontend {
@@ -39,7 +39,7 @@ public:
        /// The font instance
        QFont font;
        /// Metrics on the font
-       boost::scoped_ptr<GuiFontMetrics> metrics;
+       GuiFontMetrics metrics;
 };
 
 
@@ -51,12 +51,12 @@ public:
        GuiFontLoader();
 
        /// Destructor
-       virtual ~GuiFontLoader() {}
+       virtual ~GuiFontLoader();
 
        virtual void update();
        virtual bool available(FontInfo const & f);
        inline virtual FontMetrics const & metrics(FontInfo const & f) {
-               return *fontinfo(f).metrics.get();
+               return fontinfo(f).metrics;
        }
 
        /// Get the QFont for this FontInfo
@@ -67,6 +67,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 =