diff options
-rw-r--r-- | i18npool/inc/numberformatcode.hxx | 1 | ||||
-rw-r--r-- | i18npool/source/numberformatcode/numberformatcode.cxx | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/i18npool/inc/numberformatcode.hxx b/i18npool/inc/numberformatcode.hxx index 3b36cec9dcf0..9c7d78066d3e 100644 --- a/i18npool/inc/numberformatcode.hxx +++ b/i18npool/inc/numberformatcode.hxx @@ -54,6 +54,7 @@ public: throw( css::uno::RuntimeException, std::exception ) override; private: + osl::Mutex maMutex; css::lang::Locale aLocale; css::uno::Reference < css::uno::XComponentContext > mxContext; css::uno::Sequence< css::i18n::FormatElement > aFormatSeq; diff --git a/i18npool/source/numberformatcode/numberformatcode.cxx b/i18npool/source/numberformatcode/numberformatcode.cxx index 76beeadabdfe..e329589cc7fb 100644 --- a/i18npool/source/numberformatcode/numberformatcode.cxx +++ b/i18npool/source/numberformatcode/numberformatcode.cxx @@ -44,6 +44,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage, OUString elementType = mapElementTypeShortToString(formatType); OUString elementUsage = mapElementUsageShortToString(formatUsage); + osl::MutexGuard g(maMutex); getFormats( rLocale ); for(sal_Int32 i = 0; i < aFormatSeq.getLength(); i++) { @@ -68,6 +69,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage, css::i18n::NumberFormatCode SAL_CALL NumberFormatCodeMapper::getFormatCode( sal_Int16 formatIndex, const css::lang::Locale& rLocale ) throw(css::uno::RuntimeException, std::exception) { + osl::MutexGuard g(maMutex); getFormats( rLocale ); for(sal_Int32 i = 0; i < aFormatSeq.getLength(); i++) { @@ -92,6 +94,7 @@ NumberFormatCodeMapper::getFormatCode( sal_Int16 formatIndex, const css::lang::L css::uno::Sequence< css::i18n::NumberFormatCode > SAL_CALL NumberFormatCodeMapper::getAllFormatCode( sal_Int16 formatUsage, const css::lang::Locale& rLocale ) throw(css::uno::RuntimeException, std::exception) { + osl::MutexGuard g(maMutex); getFormats( rLocale ); sal_Int32 i, count; @@ -125,6 +128,7 @@ NumberFormatCodeMapper::getAllFormatCode( sal_Int16 formatUsage, const css::lang css::uno::Sequence< css::i18n::NumberFormatCode > SAL_CALL NumberFormatCodeMapper::getAllFormatCodes( const css::lang::Locale& rLocale ) throw(css::uno::RuntimeException, std::exception) { + osl::MutexGuard g(maMutex); getFormats( rLocale ); css::uno::Sequence<css::i18n::NumberFormatCode> seq(aFormatSeq.getLength()); |