Index: vcl/source/gdi/fontcfg.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/gdi/fontcfg.cxx,v
retrieving revision 1.40
diff -u -p -u -r1.40 fontcfg.cxx
--- vcl/source/gdi/fontcfg.cxx	20 Jul 2006 16:08:23 -0000	1.40
+++ vcl/source/gdi/fontcfg.cxx	23 Aug 2006 20:08:12 -0000
@@ -408,7 +408,8 @@ FontSubstConfiguration* FontSubstConfigu
  *  FontSubstConfigItem::FontSubstConfigItem
  */
 
-FontSubstConfiguration::FontSubstConfiguration()
+FontSubstConfiguration::FontSubstConfiguration() :
+	maSubstHash( 300 )
 {
     try
     {
@@ -974,7 +975,14 @@ void FontSubstConfiguration::fillSubstVe
                 {
                     OUString aSubst( pLine->getToken( 0, ';', nIndex ) );
                     if( aSubst.getLength() )
+					{
+						UniqueSubstHash::const_iterator aEntry = maSubstHash.find( aSubst );
+						if (aEntry != maSubstHash.end())
+							aSubst = *aEntry;
+						else
+							((FontSubstConfiguration *)this)->maSubstHash.insert( aSubst );
                         rSubstVector.push_back( aSubst );
+					}
                 }
         }
     }


Index: vcl/inc/fontcfg.hxx
===================================================================
RCS file: /cvs/gsl/vcl/inc/fontcfg.hxx,v
retrieving revision 1.11
diff -u -p -u -r1.11 fontcfg.hxx
--- vcl/inc/fontcfg.hxx	4 May 2006 15:09:47 -0000	1.11
+++ vcl/inc/fontcfg.hxx	23 Aug 2006 20:08:12 -0000
@@ -56,6 +56,7 @@
 #endif
 
 #include <hash_map>
+#include <hash_set>
 #include <vector>
 
 namespace com {
@@ -212,6 +213,9 @@ private:
         LocaleSubst() : bConfigRead( false ) {}
     };
     std::hash_map< com::sun::star::lang::Locale, LocaleSubst, vcl::LocaleHash > m_aSubst;
+	typedef std::hash_set< rtl::OUString, rtl::OUStringHash > UniqueSubstHash;
+	UniqueSubstHash maSubstHash;
+
     
     void fillSubstVector( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
                           const rtl::OUString& rType,
