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 /unotools | |
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 'unotools')
-rw-r--r-- | unotools/source/config/configitem.cxx | 9 | ||||
-rw-r--r-- | unotools/source/config/configmgr.cxx | 12 | ||||
-rw-r--r-- | unotools/source/config/saveopt.cxx | 15 | ||||
-rw-r--r-- | unotools/source/config/viewoptions.cxx | 3 | ||||
-rw-r--r-- | unotools/source/misc/syslocale.cxx | 12 |
5 files changed, 44 insertions, 7 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index bb46aa794a4c..08f2f7180c81 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -176,7 +176,10 @@ ConfigItem::ConfigItem(const OUString &rSubTree, ConfigItemMode nSetMode ) : m_bEnableInternalNotification(false), m_nInValueChange(0) { - if(nSetMode & ConfigItemMode::ReleaseTree) + if (utl::ConfigManager::IsAvoidConfig()) + return; + + if (nSetMode & ConfigItemMode::ReleaseTree) ConfigManager::getConfigManager().addConfigItem(*this); else m_xHierarchyAccess = ConfigManager::getConfigManager().addConfigItem(*this); @@ -1110,11 +1113,11 @@ void ConfigItem::ClearModified() m_bIsModified = false; } - - Reference< XHierarchicalNameAccess> ConfigItem::GetTree() { Reference< XHierarchicalNameAccess> xRet; + if (utl::ConfigManager::IsAvoidConfig()) + return xRet; if(!m_xHierarchyAccess.is()) xRet = ConfigManager::acquireTree(*this); else diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index bf74b5323653..91a77ef8e8a9 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -204,4 +204,16 @@ void utl::ConfigManager::doStoreConfigItems() { } } +static bool bIsAvoidConfig = false; + +bool utl::ConfigManager::IsAvoidConfig() +{ + return bIsAvoidConfig; +} + +void utl::ConfigManager::EnableAvoidConfig() +{ + bIsAvoidConfig = true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index ccea2c533af8..fd6f0736233d 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -567,9 +567,18 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() } } - bAutoSave = officecfg::Office::Recovery::AutoSave::Enabled::get(); - nAutoSaveTime = officecfg::Office::Recovery::AutoSave::TimeIntervall::get(); - bUserAutoSave = officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get(); + if (!utl::ConfigManager::IsAvoidConfig()) + { + bAutoSave = officecfg::Office::Recovery::AutoSave::Enabled::get(); + nAutoSaveTime = officecfg::Office::Recovery::AutoSave::TimeIntervall::get(); + bUserAutoSave = officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get(); + } + else + { + bAutoSave = false; + nAutoSaveTime = 0; + bUserAutoSave = false; + } } SvtSaveOptions_Impl::~SvtSaveOptions_Impl() diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index 95282f0e35c9..ef336153f7b3 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -149,6 +149,9 @@ SvtViewOptionsBase_Impl::SvtViewOptionsBase_Impl( const OUString& sList ) , m_nWriteCount( 0 ) #endif { + if (utl::ConfigManager::IsAvoidConfig()) + return; + try { m_xRoot = css::uno::Reference< css::container::XNameAccess >( diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx index 179052045869..117d5d854380 100644 --- a/unotools/source/misc/syslocale.cxx +++ b/unotools/source/misc/syslocale.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <sal/log.hxx> +#include <unotools/configmgr.hxx> #include <unotools/syslocale.hxx> #include <unotools/syslocaleoptions.hxx> #include <comphelper/processfactory.hxx> @@ -54,7 +55,13 @@ private: SvtSysLocale_Impl::SvtSysLocale_Impl() : pCharClass(NULL) { - pLocaleData = new LocaleDataWrapper( aSysLocaleOptions.GetRealLanguageTag() ); + if (utl::ConfigManager::IsAvoidConfig()) + { + pLocaleData = NULL; + return; + } + + pLocaleData = new LocaleDataWrapper(aSysLocaleOptions.GetRealLanguageTag()); setDateAcceptancePatternsConfig(); // listen for further changes @@ -114,6 +121,9 @@ void SvtSysLocale_Impl::setDateAcceptancePatternsConfig() SvtSysLocale::SvtSysLocale() { + if (utl::ConfigManager::IsAvoidConfig()) + return; + MutexGuard aGuard( GetMutex() ); if ( !pImpl ) pImpl = new SvtSysLocale_Impl; |