diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-10 11:04:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-19 01:04:00 +0000 |
commit | 6b7354ae66db40246a09e00aa876443057655a43 (patch) | |
tree | e7eb5d71ecd2a6ec8110945a946549500dae7a8a /editeng | |
parent | 5120b3f30614f6e4988c512577da1d70be8d25b1 (diff) |
for testing allow disabling configmgr for time critical paths
Change-Id: I08021f18d53e1748927f8847649994f95252bbc2
Reviewed-on: https://gerrit.libreoffice.org/17844
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 24 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/items/numitem.cxx | 7 |
4 files changed, 26 insertions, 13 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 910b4872c844..ea3a5f919c5d 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1294,18 +1294,24 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1)); LanguageTag aLanguageTag( eLang); - if (!pImpEditEngine->xLocaleDataWrapper.isInitialized()) - pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag); + if (!pImpEditEngine->pLocaleDataWrapper) + pImpEditEngine->pLocaleDataWrapper = new OnDemandLocaleDataWrapper; + + if (!pImpEditEngine->pLocaleDataWrapper->isInitialized()) + pImpEditEngine->pLocaleDataWrapper->init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag); else - pImpEditEngine->xLocaleDataWrapper.changeLocale( aLanguageTag); + pImpEditEngine->pLocaleDataWrapper->changeLocale( aLanguageTag); + + if (!pImpEditEngine->pTransliterationWrapper) + pImpEditEngine->pTransliterationWrapper = new OnDemandTransliterationWrapper; - if (!pImpEditEngine->xTransliterationWrapper.isInitialized()) - pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE); + if (!pImpEditEngine->pTransliterationWrapper->isInitialized()) + pImpEditEngine->pTransliterationWrapper->init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE); else - pImpEditEngine->xTransliterationWrapper.changeLocale( eLang); + pImpEditEngine->pTransliterationWrapper->changeLocale( eLang); - const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->xTransliterationWrapper.get(); - Sequence< i18n::CalendarItem2 > xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarDays(); + const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->pTransliterationWrapper->get(); + Sequence< i18n::CalendarItem2 > xItem = pImpEditEngine->pLocaleDataWrapper->get()->getDefaultCalendarDays(); sal_Int32 nCount = xItem.getLength(); const i18n::CalendarItem2* pArr = xItem.getArray(); for( sal_Int32 n = 0; n <= nCount; ++n ) @@ -1320,7 +1326,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v if ( aComplete.isEmpty() ) { - xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarMonths(); + xItem = pImpEditEngine->pLocaleDataWrapper->get()->getDefaultCalendarMonths(); sal_Int32 nMonthCount = xItem.getLength(); const i18n::CalendarItem2* pMonthArr = xItem.getArray(); for( sal_Int32 n = 0; n <= nMonthCount; ++n ) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 793a85eb1331..5ce5524ed385 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -464,8 +464,8 @@ private: LanguageType eDefLanguage; - OnDemandLocaleDataWrapper xLocaleDataWrapper; - OnDemandTransliterationWrapper xTransliterationWrapper; + OnDemandLocaleDataWrapper* pLocaleDataWrapper; + OnDemandTransliterationWrapper* pTransliterationWrapper; // For Formatting / Update .... boost::ptr_vector<DeletedNodeInfo> aDeletedNodes; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 8269dae61488..9dec70e0e0f1 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -129,6 +129,8 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : nStretchY = 100; eDefLanguage = LANGUAGE_DONTKNOW; + pLocaleDataWrapper = 0; + pTransliterationWrapper = 0; maBackgroundColor = COL_AUTO; nAsianCompressionMode = text::CharacterCompressionType::NONE; @@ -182,6 +184,8 @@ ImpEditEngine::~ImpEditEngine() delete pCTLOptions; if ( bOwnerOfRefDev ) pRefDev.disposeAndClear(); + delete pLocaleDataWrapper; + delete pTransliterationWrapper; delete pSpellInfo; } diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 99ad41eea108..b44355f0b4c9 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <comphelper/processfactory.hxx> #include <tools/mapunit.hxx> +#include <unotools/configmgr.hxx> #include <editeng/unonrule.hxx> @@ -99,8 +100,10 @@ SvxNumberType::~SvxNumberType() OUString SvxNumberType::GetNumStr( sal_uLong nNo ) const { - const LanguageTag& rLang = Application::GetSettings().GetLanguageTag(); - return GetNumStr( nNo, rLang.getLocale() ); + LanguageTag aLang = utl::ConfigManager::IsAvoidConfig() ? + LanguageTag("en-US") : + Application::GetSettings().GetLanguageTag(); + return GetNumStr( nNo, aLang.getLocale() ); } OUString SvxNumberType::GetNumStr( sal_uLong nNo, const css::lang::Locale& rLocale ) const |