diff options
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/fontcfg.hxx | 2 | ||||
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 9 | ||||
-rw-r--r-- | unotools/source/misc/fontdefs.cxx | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/unotools/inc/unotools/fontcfg.hxx b/unotools/inc/unotools/fontcfg.hxx index d370350484c1..6c2295805afd 100644 --- a/unotools/inc/unotools/fontcfg.hxx +++ b/unotools/inc/unotools/fontcfg.hxx @@ -211,7 +211,7 @@ private: public: ~FontSubstConfiguration(); - static FontSubstConfiguration* get(); + static FontSubstConfiguration& get(); const FontNameAttr* getSubstInfo( const String& rFontName, diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 6ff32c0b6e71..c3dc28acf079 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -61,8 +61,6 @@ using ::rtl::OUString; static DefaultFontConfiguration* mpDefaultFontConfiguration = 0; -static FontSubstConfiguration* mpFontSubstConfiguration = 0; - /* * DefaultFontConfiguration */ @@ -375,11 +373,10 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale ) * FontSubstConfigItem::get */ -FontSubstConfiguration* FontSubstConfiguration::get() +FontSubstConfiguration& FontSubstConfiguration::get() { - if( !mpFontSubstConfiguration ) - mpFontSubstConfiguration = new FontSubstConfiguration(); - return mpFontSubstConfiguration; + static FontSubstConfiguration aFontSubstConfiguration; + return aFontSubstConfiguration; } /* diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index c89427dd27a2..d51c30ec7f58 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -542,7 +542,7 @@ String GetSubsFontName( const String& rName, sal_uLong nFlags ) || aOrgName.EqualsAscii( "opensymbol" ) ) ) return aName; - const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get()->getSubstInfo( aOrgName ); + const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName ); if ( pAttr ) { for( int i = 0; i < 3; i++ ) |