summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
Diffstat (limited to 'unotools')
-rw-r--r--unotools/inc/unotools/fontcfg.hxx2
-rw-r--r--unotools/source/config/fontcfg.cxx9
2 files changed, 4 insertions, 7 deletions
diff --git a/unotools/inc/unotools/fontcfg.hxx b/unotools/inc/unotools/fontcfg.hxx
index 6c2295805afd..136147a095d4 100644
--- a/unotools/inc/unotools/fontcfg.hxx
+++ b/unotools/inc/unotools/fontcfg.hxx
@@ -97,7 +97,7 @@ class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
public:
~DefaultFontConfiguration();
- static DefaultFontConfiguration* get();
+ static DefaultFontConfiguration& get();
rtl::OUString getDefaultFont( const com::sun::star::lang::Locale& rLocale, int nType ) const;
rtl::OUString getUserInterfaceFont( const com::sun::star::lang::Locale& rLocale ) const;
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index c3dc28acf079..5786e96af8cc 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -59,8 +59,6 @@ using namespace com::sun::star::container;
using ::rtl::OUString;
-static DefaultFontConfiguration* mpDefaultFontConfiguration = 0;
-
/*
* DefaultFontConfiguration
*/
@@ -98,11 +96,10 @@ static const char* getKeyType( int nKeyType )
}
}
-DefaultFontConfiguration* DefaultFontConfiguration::get()
+DefaultFontConfiguration& DefaultFontConfiguration::get()
{
- if( !mpDefaultFontConfiguration )
- mpDefaultFontConfiguration = new DefaultFontConfiguration();
- return mpDefaultFontConfiguration;
+ static DefaultFontConfiguration aDefaultFontConfiguration;
+ return aDefaultFontConfiguration;
}
DefaultFontConfiguration::DefaultFontConfiguration()