diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-30 15:29:09 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-06 09:01:26 +0200 |
commit | b35828ba7dc33af81d17c8c870ec981d18a57b08 (patch) | |
tree | db0d9185e5dbfd2bcc4d756a95e0e886f3a3999f /unotools/source | |
parent | c8fdfc39ebf89e10bc01bf9569b29b5b4c85d40d (diff) |
convert CONFIG_MODE constants to scoped enum
Change-Id: I1b0fb976e7bf8d7de06da0c30012e8bba1320498
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/configitem.cxx | 14 | ||||
-rw-r--r-- | unotools/source/config/configmgr.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/eventcfg.cxx | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 97c4fabedcbd..2e32a0e0d8c1 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -167,14 +167,14 @@ void ConfigChangeListener_Impl::disposing( const EventObject& /*rSource*/ ) thro pParent->RemoveChangesListener(); } -ConfigItem::ConfigItem(const OUString &rSubTree, sal_Int16 nSetMode ) : +ConfigItem::ConfigItem(const OUString &rSubTree, ConfigItemMode nSetMode ) : sSubTree(rSubTree), m_nMode(nSetMode), m_bIsModified(false), m_bEnableInternalNotification(false), m_nInValueChange(0) { - if(0 != (nSetMode&CONFIG_MODE_RELEASE_TREE)) + if(nSetMode & ConfigItemMode::ReleaseTree) ConfigManager::getConfigManager().addConfigItem(*this); else m_xHierarchyAccess = ConfigManager::getConfigManager().addConfigItem(*this); @@ -201,7 +201,7 @@ void ConfigItem::impl_packLocalizedProperties( const Sequence< OUString >& { // Safe impossible cases. // This method should be called for special ConfigItem-mode only! - OSL_ENSURE( ((m_nMode & CONFIG_MODE_ALL_LOCALES ) == CONFIG_MODE_ALL_LOCALES), "ConfigItem::impl_packLocalizedProperties()\nWrong call of this method detected!\n" ); + OSL_ENSURE( ((m_nMode & ConfigItemMode::AllLocales ) == ConfigItemMode::AllLocales), "ConfigItem::impl_packLocalizedProperties()\nWrong call of this method detected!\n" ); sal_Int32 nSourceCounter; // used to step during input lists sal_Int32 nSourceSize; // marks end of loop over input lists @@ -269,7 +269,7 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString > { // Safe impossible cases. // This method should be called for special ConfigItem-mode only! - OSL_ENSURE( ((m_nMode & CONFIG_MODE_ALL_LOCALES ) == CONFIG_MODE_ALL_LOCALES), "ConfigItem::impl_unpackLocalizedProperties()\nWrong call of this method detected!\n" ); + OSL_ENSURE( ((m_nMode & ConfigItemMode::AllLocales ) == ConfigItemMode::AllLocales), "ConfigItem::impl_unpackLocalizedProperties()\nWrong call of this method detected!\n" ); sal_Int32 nSourceCounter; // used to step during input lists sal_Int32 nSourceSize; // marks end of loop over input lists @@ -442,7 +442,7 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames) } // In special mode "ALL_LOCALES" we must convert localized values to Sequence< PropertyValue >. - if((m_nMode & CONFIG_MODE_ALL_LOCALES ) == CONFIG_MODE_ALL_LOCALES) + if((m_nMode & ConfigItemMode::AllLocales ) == ConfigItemMode::AllLocales) { Sequence< Any > lValues; impl_packLocalizedProperties( rNames, aRet, lValues ); @@ -466,7 +466,7 @@ bool ConfigItem::PutProperties( const Sequence< OUString >& rNames, const OUString* pNames = NULL; const Any* pValues = NULL; sal_Int32 nNameCount; - if(( m_nMode & CONFIG_MODE_ALL_LOCALES ) == CONFIG_MODE_ALL_LOCALES ) + if(( m_nMode & ConfigItemMode::AllLocales ) == ConfigItemMode::AllLocales ) { // If ConfigItem works in "ALL_LOCALES"-mode ... we must support a Sequence< PropertyValue > // as value of an localized configuration entry! @@ -536,7 +536,7 @@ bool ConfigItem::EnableNotification(const Sequence< OUString >& rNames, bool bEnableInternalNotification ) { - OSL_ENSURE(0 == (m_nMode&CONFIG_MODE_RELEASE_TREE), "notification in CONFIG_MODE_RELEASE_TREE mode not possible"); + OSL_ENSURE(bool(m_nMode & ConfigItemMode::ReleaseTree), "notification in ConfigItemMode::ReleaseTree mode not possible"); m_bEnableInternalNotification = bEnableInternalNotification; Reference<XHierarchicalNameAccess> xHierarchyAccess = GetTree(); Reference<XChangesNotifier> xChgNot(xHierarchyAccess, UNO_QUERY); diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index c0a79eb7e3e6..bf74b5323653 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -151,7 +151,7 @@ utl::ConfigManager::acquireTree(utl::ConfigItem & item) { args[0] <<= css::beans::NamedValue( OUString("nodepath"), css::uno::makeAny("/org.openoffice." + item.GetSubTreeName())); - if ((item.GetMode() & CONFIG_MODE_ALL_LOCALES) != 0) { + if (item.GetMode() & ConfigItemMode::AllLocales) { args.realloc(2); args[1] <<= css::beans::NamedValue(OUString("locale"), css::uno::makeAny(OUString("*"))); } diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 49cf4f960d10..fc862ac689b1 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -109,7 +109,7 @@ public: GlobalEventConfig_Impl::GlobalEventConfig_Impl() - : ConfigItem( ROOTNODE_EVENTS, CONFIG_MODE_IMMEDIATE_UPDATE ) + : ConfigItem( ROOTNODE_EVENTS, ConfigItemMode::ImmediateUpdate ) { // the supported event names for (GlobalEventId id : o3tl::enumrange<GlobalEventId>()) |