]> git.lyx.org Git - lyx.git/blobdiff - src/FontInfo.h
fix typo that put too many include paths for most people
[lyx.git] / src / FontInfo.h
index 3bc79d913599721eb1a2b16d3060c0e832ad5338..7f4af1d4c7e574953a344c1fc63cf212bacf68c1 100644 (file)
@@ -1,16 +1,16 @@
 // -*- C++ -*-
 /* This file is part of
  * ======================================================
 // -*- C++ -*-
 /* This file is part of
  * ======================================================
- * 
+ *
  *           LyX, The Document Processor
  *           LyX, The Document Processor
- *      
+ *
  *           Copyright 1997 Asger Alstrup
  *           and the LyX Team.
  *
  * ====================================================== */
 
 #ifndef FONTINFO_H
  *           Copyright 1997 Asger Alstrup
  *           and the LyX Team.
  *
  * ====================================================== */
 
 #ifndef FONTINFO_H
-#define FONTINFO_H 
+#define FONTINFO_H
 
 #ifdef __GNUG__
 #pragma interface
 
 #ifdef __GNUG__
 #pragma interface
 
 #include "LString.h"
 
 
 #include "LString.h"
 
+#include <boost/smart_ptr.hpp>
+
 /** This class manages a font.
 /** This class manages a font.
-    The idea is to create a FontInfo object with a font name pattern with a 
+    The idea is to create a FontInfo object with a font name pattern with a
     wildcard at the size field. Then this object can host request for font-
     instances of any given size. If no exact match is found, the closest size
     is chosen instead. If the font is scalable, the flag
     wildcard at the size field. Then this object can host request for font-
     instances of any given size. If no exact match is found, the closest size
     is chosen instead. If the font is scalable, the flag
@@ -35,9 +37,6 @@ public:
        explicit FontInfo(string const & pat)
                : pattern(pat) { init(); }
 
        explicit FontInfo(string const & pat)
                : pattern(pat) { init(); }
 
-       /// Destructor
-       ~FontInfo() { release(); }
-
        /// Does any font match our pattern?
        bool exist() {
                query();
        /// Does any font match our pattern?
        bool exist() {
                query();
@@ -51,7 +50,7 @@ public:
        }
 
        /// Get existing pattern
        }
 
        /// Get existing pattern
-       string const getPattern() const { return pattern; }
+       string const getPattern() const { return pattern; }
 
        /// Set new pattern
        void setPattern(string const & pat);
 
        /// Set new pattern
        void setPattern(string const & pat);
@@ -64,10 +63,10 @@ private:
        string pattern;
 
        /// Available size list
        string pattern;
 
        /// Available size list
-       int * sizes;
+       boost::scoped_array<int> sizes;
 
        /// Corresponding name list
 
        /// Corresponding name list
-       string * strings;
+       boost::scoped_array<string> strings;
 
        /// Number of matches
        int matches;
 
        /// Number of matches
        int matches;
@@ -84,13 +83,10 @@ private:
        /// Initialize empty record
        void init();
 
        /// Initialize empty record
        void init();
 
-       /// Release allocated stuff
-       void release();
-
        /// Ask X11 about this font pattern
        void query();
 
        /// Ask X11 about this font pattern
        void query();
 
-       /// Build newly sized font string 
+       /// Build newly sized font string
        string const resize(string const &, int size) const;
 };
 #endif
        string const resize(string const &, int size) const;
 };
 #endif