From 24d59c9e044dfc04013b5d364237245b314f62ed Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 4 May 2018 10:56:58 +0200 Subject: configure option to disable libnumbertext Because we get a crash in CppunitTest_sw_odfexport when compiling with clang >= 6.0.0 Also had to fix the ENABLE_LIBNUMBERTEXT being propogated, and the way the code checked it. Change-Id: I68e4a0078016d176f478ca4c1110fc296b6ca921 --- lingucomponent/source/numbertext/numbertext.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lingucomponent') diff --git a/lingucomponent/source/numbertext/numbertext.cxx b/lingucomponent/source/numbertext/numbertext.cxx index ec841a4bcab2..ee3ecbab9818 100644 --- a/lingucomponent/source/numbertext/numbertext.cxx +++ b/lingucomponent/source/numbertext/numbertext.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include @@ -37,7 +38,7 @@ #include -#ifdef ENABLE_LIBNUMBERTEXT +#if ENABLE_LIBNUMBERTEXT #include #endif @@ -67,7 +68,7 @@ static osl::Mutex& GetNumberTextMutex() class NumberText_Impl : public ::cppu::WeakImplHelper { -#if defined(ENABLE_LIBNUMBERTEXT) || defined(SYSTEM_LIBNUMBERTEXT) +#if ENABLE_LIBNUMBERTEXT Numbertext m_aNumberText; #endif bool m_bInitialized; @@ -114,7 +115,7 @@ void NumberText_Impl::EnsureInitialized() #else aPhysPath += "/"; #endif -#if defined(ENABLE_LIBNUMBERTEXT) || defined(SYSTEM_LIBNUMBERTEXT) +#if ENABLE_LIBNUMBERTEXT OString path = OUStringToOString(aPhysPath, osl_getThreadTextEncoding()); m_aNumberText.set_prefix(path.getStr()); #endif @@ -122,7 +123,7 @@ void NumberText_Impl::EnsureInitialized() } OUString SAL_CALL NumberText_Impl::getNumberText(const OUString& rText, const Locale& -#if defined(ENABLE_LIBNUMBERTEXT) || defined(SYSTEM_LIBNUMBERTEXT) +#if ENABLE_LIBNUMBERTEXT rLocale) #else ) @@ -130,7 +131,7 @@ OUString SAL_CALL NumberText_Impl::getNumberText(const OUString& rText, const Lo { osl::MutexGuard aGuard(GetNumberTextMutex()); EnsureInitialized(); -#if defined(ENABLE_LIBNUMBERTEXT) || defined(SYSTEM_LIBNUMBERTEXT) +#if ENABLE_LIBNUMBERTEXT // libnumbertext supports Language + Country tags (separated by "_" or "-") LanguageTag aLanguageTag(rLocale); OUString aCode(aLanguageTag.getLanguage()); -- cgit