summaryrefslogtreecommitdiff
path: root/linguistic/source/misc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'linguistic/source/misc.cxx')
-rw-r--r--linguistic/source/misc.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 3e0beddada2d..59214bed4500 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -74,11 +74,10 @@ osl::Mutex & GetLinguMutex()
const LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang )
{
- static LocaleDataWrapper aLclDtaWrp( SvtSysLocale().GetLanguageTag() );
-
- if (nLang != aLclDtaWrp.getLoadedLanguageTag().getLanguageType())
- aLclDtaWrp.setLanguageTag( LanguageTag( nLang ) );
- return aLclDtaWrp;
+ static std::unique_ptr<LocaleDataWrapper> xLclDtaWrp;
+ if (!xLclDtaWrp || xLclDtaWrp->getLoadedLanguageTag().getLanguageType() != nLang)
+ xLclDtaWrp.reset(new LocaleDataWrapper(LanguageTag( nLang )));
+ return *xLclDtaWrp;
}
LanguageType LinguLocaleToLanguage( const css::lang::Locale& rLocale )