Commit 93a9d2ec7737a8f0638ea0db8d8bf1ee5cb044a9

henry 2002-12-04T08:20:18

Error checking in Add Un-virtualised some functions Minor tidy ups

diff --git a/include/FTGlyphContainer.h b/include/FTGlyphContainer.h
index baad88d..d536bc5 100755
--- a/include/FTGlyphContainer.h
+++ b/include/FTGlyphContainer.h
@@ -6,11 +6,12 @@
 #include FT_GLYPH_H
 
 #include "FTGL.h"
-#include "FTVector.h"
-#include "FTGlyph.h"
+#include "FTBBox.h"
 #include "FTPoint.h"
+#include "FTVector.h"
 
 class FTFace;
+class FTGlyph;
 
 /**
  * FTGlyphContainer holds the post processed FTGlyph objects.
@@ -31,7 +32,7 @@ class FTGL_EXPORT FTGlyphContainer
         /**
          * Destructor
          */
-        virtual ~FTGlyphContainer();
+        ~FTGlyphContainer();
 
         /**
          * Adds a glyph to this glyph list.
@@ -77,16 +78,16 @@ class FTGL_EXPORT FTGlyphContainer
          *
          * @return  The current error code.
          */
-        virtual FT_Error Error() const { return err;}
+        FT_Error Error() const { return err;}
 
     private:
         /**
-         * How meny glyphs are stored in this container
+         * How many glyphs are reserved in this container
          */
         int numGlyphs;
 
         /**
-         * The current Freetype face
+         * The current FTGL face
          */
         FTFace* face;
 
diff --git a/src/FTGlyphContainer.cpp b/src/FTGlyphContainer.cpp
index 0527b1b..73e6835 100755
--- a/src/FTGlyphContainer.cpp
+++ b/src/FTGlyphContainer.cpp
@@ -29,6 +29,11 @@ FTGlyphContainer::~FTGlyphContainer()
 
 bool FTGlyphContainer::Add( FTGlyph* tempGlyph, unsigned int g)
 {
+    if( g >= numGlyphs)
+    {
+        return false;
+    }
+    
     glyphs[g] = tempGlyph;
     return true;
 }