diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 11:26:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 11:27:51 +0200 |
commit | 04a84913ead2f82510d91eea2bb8526274feeeae (patch) | |
tree | a123ff892b74a778c6ae61de2e5caa2ee916416f /unotools | |
parent | a250292c5eb7e4cdb2aa83bc08ae6c86c3ca65a1 (diff) |
use o3tl::typed_flags in ConfigurationListener::ConfigurationChanged
Change-Id: I0ad7c02953aa53168dc242f1f374ab871728c84e
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/options.cxx | 10 | ||||
-rw-r--r-- | unotools/source/config/syslocaleoptions.cxx | 32 | ||||
-rw-r--r-- | unotools/source/config/useroptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/misc/syslocale.cxx | 8 |
5 files changed, 28 insertions, 28 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index c9d9c639c6a1..96f21575bb30 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -206,7 +206,7 @@ SvtLinguConfigItem::~SvtLinguConfigItem() void SvtLinguConfigItem::Notify( const uno::Sequence< OUString > &rPropertyNames ) { LoadOptions( rPropertyNames ); - NotifyListeners(0); + NotifyListeners(ConfigurationHints::NONE); } void SvtLinguConfigItem::ImplCommit() @@ -536,7 +536,7 @@ bool SvtLinguConfigItem::SetProperty( sal_Int32 nPropertyHandle, const uno::Any if (bMod) SetModified(); - NotifyListeners(0); + NotifyListeners(ConfigurationHints::NONE); return bSucc; } diff --git a/unotools/source/config/options.cxx b/unotools/source/config/options.cxx index 435a453219a5..c6e66c502aca 100644 --- a/unotools/source/config/options.cxx +++ b/unotools/source/config/options.cxx @@ -28,7 +28,7 @@ utl::ConfigurationListener::~ConfigurationListener() {} ConfigurationBroadcaster::ConfigurationBroadcaster() : mpList(nullptr) , m_nBroadcastBlocked( 0 ) -, m_nBlockedHint( 0 ) +, m_nBlockedHint( ConfigurationHints::NONE ) { } @@ -59,14 +59,14 @@ void ConfigurationBroadcaster::RemoveListener( utl::ConfigurationListener* pList } } -void ConfigurationBroadcaster::NotifyListeners( sal_uInt32 nHint ) +void ConfigurationBroadcaster::NotifyListeners( ConfigurationHints nHint ) { if ( m_nBroadcastBlocked ) m_nBlockedHint |= nHint; else { nHint |= m_nBlockedHint; - m_nBlockedHint = 0; + m_nBlockedHint = ConfigurationHints::NONE; if ( mpList ) { for ( size_t n = 0; n < mpList->size(); n++ ) (*mpList)[ n ]->ConfigurationChanged( this, nHint ); @@ -81,7 +81,7 @@ void ConfigurationBroadcaster::BlockBroadcasts( bool bBlock ) else if ( m_nBroadcastBlocked ) { if ( --m_nBroadcastBlocked == 0 ) - NotifyListeners( 0 ); + NotifyListeners( ConfigurationHints::NONE ); } } @@ -93,7 +93,7 @@ Options::~Options() { } -void Options::ConfigurationChanged( ConfigurationBroadcaster*, sal_uInt32 nHint ) +void Options::ConfigurationChanged( ConfigurationBroadcaster*, ConfigurationHints nHint ) { NotifyListeners( nHint ); } diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 9b24977f949c..5f3b00cdf1f3 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -394,9 +394,9 @@ void SvtSysLocaleOptions_Impl::SetLocaleString( const OUString& rStr ) MakeRealLocale(); LanguageTag::setConfiguredSystemLanguage( m_aRealLocale.getLanguageType() ); SetModified(); - sal_uInt32 nHint = SYSLOCALEOPTIONS_HINT_LOCALE; + ConfigurationHints nHint = ConfigurationHints::Locale; if ( m_aCurrencyString.isEmpty() ) - nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; + nHint |= ConfigurationHints::Currency; NotifyListeners( nHint ); } } @@ -410,7 +410,7 @@ void SvtSysLocaleOptions_Impl::SetUILocaleString( const OUString& rStr ) // as we can't switch UILocale at runtime, we only store changes in the configuration MakeRealUILocale(); SetModified(); - NotifyListeners( SYSLOCALEOPTIONS_HINT_UILOCALE ); + NotifyListeners( ConfigurationHints::UiLocale ); } } @@ -420,7 +420,7 @@ void SvtSysLocaleOptions_Impl::SetCurrencyString( const OUString& rStr ) { m_aCurrencyString = rStr; SetModified(); - NotifyListeners( SYSLOCALEOPTIONS_HINT_CURRENCY ); + NotifyListeners( ConfigurationHints::Currency ); } } @@ -430,7 +430,7 @@ void SvtSysLocaleOptions_Impl::SetDatePatternsString( const OUString& rStr ) { m_aDatePatternsString = rStr; SetModified(); - NotifyListeners( SYSLOCALEOPTIONS_HINT_DATEPATTERNS ); + NotifyListeners( ConfigurationHints::DatePatterns ); } } @@ -440,7 +440,7 @@ void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( bool bSet) { m_bDecimalSeparator = bSet; SetModified(); - NotifyListeners( SYSLOCALEOPTIONS_HINT_DECSEP ); + NotifyListeners( ConfigurationHints::DecSep ); } } @@ -450,13 +450,13 @@ void SvtSysLocaleOptions_Impl::SetIgnoreLanguageChange( bool bSet) { m_bIgnoreLanguageChange = bSet; SetModified(); - NotifyListeners( SYSLOCALEOPTIONS_HINT_IGNORELANG ); + NotifyListeners( ConfigurationHints::IgnoreLang ); } } void SvtSysLocaleOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) { - sal_uInt32 nHint = 0; + ConfigurationHints nHint = ConfigurationHints::NONE; Sequence< Any > seqValues = GetProperties( seqPropertyNames ); Sequence< sal_Bool > seqROStates = GetReadOnlyStates( seqPropertyNames ); sal_Int32 nCount = seqPropertyNames.getLength(); @@ -467,9 +467,9 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNa DBG_ASSERT( seqValues[nProp].getValueTypeClass() == TypeClass_STRING, "Locale property type" ); seqValues[nProp] >>= m_aLocaleString; m_bROLocale = seqROStates[nProp]; - nHint |= SYSLOCALEOPTIONS_HINT_LOCALE; + nHint |= ConfigurationHints::Locale; if ( m_aCurrencyString.isEmpty() ) - nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; + nHint |= ConfigurationHints::Currency; MakeRealLocale(); } if( seqPropertyNames[nProp] == PROPERTYNAME_UILOCALE ) @@ -477,7 +477,7 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNa DBG_ASSERT( seqValues[nProp].getValueTypeClass() == TypeClass_STRING, "Locale property type" ); seqValues[nProp] >>= m_aUILocaleString; m_bROUILocale = seqROStates[nProp]; - nHint |= SYSLOCALEOPTIONS_HINT_UILOCALE; + nHint |= ConfigurationHints::UiLocale; MakeRealUILocale(); } else if( seqPropertyNames[nProp] == PROPERTYNAME_CURRENCY ) @@ -485,7 +485,7 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNa DBG_ASSERT( seqValues[nProp].getValueTypeClass() == TypeClass_STRING, "Currency property type" ); seqValues[nProp] >>= m_aCurrencyString; m_bROCurrency = seqROStates[nProp]; - nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; + nHint |= ConfigurationHints::Currency; } else if( seqPropertyNames[nProp] == PROPERTYNAME_DECIMALSEPARATOR ) { @@ -502,10 +502,10 @@ void SvtSysLocaleOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNa DBG_ASSERT( seqValues[nProp].getValueTypeClass() == TypeClass_STRING, "DatePatterns property type" ); seqValues[nProp] >>= m_aDatePatternsString; m_bRODatePatterns = seqROStates[nProp]; - nHint |= SYSLOCALEOPTIONS_HINT_DATEPATTERNS; + nHint |= ConfigurationHints::DatePatterns; } } - if ( nHint ) + if ( nHint != ConfigurationHints::NONE ) NotifyListeners( nHint ); } @@ -689,9 +689,9 @@ const Link<LinkParamNone*,void>& SvtSysLocaleOptions::GetCurrencyChangeLink() return CurrencyChangeLink::get(); } -void SvtSysLocaleOptions::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt32 nHint ) +void SvtSysLocaleOptions::ConfigurationChanged( utl::ConfigurationBroadcaster* p, ConfigurationHints nHint ) { - if ( nHint & SYSLOCALEOPTIONS_HINT_CURRENCY ) + if ( nHint & ConfigurationHints::Currency ) { const Link<LinkParamNone*,void>& rLink = GetCurrencyChangeLink(); rLink.Call( nullptr ); diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx index 292c0001a9ab..747997dcca61 100644 --- a/unotools/source/config/useroptions.cxx +++ b/unotools/source/config/useroptions.cxx @@ -217,7 +217,7 @@ OUString SvtUserOptions::Impl::GetFullName () const void SvtUserOptions::Impl::Notify () { - NotifyListeners(0); + NotifyListeners(ConfigurationHints::NONE); } bool SvtUserOptions::Impl::IsTokenReadonly (UserOptToken nToken) const diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx index 6b0155b8653b..0955090391a2 100644 --- a/unotools/source/misc/syslocale.cxx +++ b/unotools/source/misc/syslocale.cxx @@ -51,7 +51,7 @@ public: virtual ~SvtSysLocale_Impl() override; CharClass* GetCharClass(); - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) override; + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override; private: void setDateAcceptancePatternsConfig(); @@ -80,17 +80,17 @@ CharClass* SvtSysLocale_Impl::GetCharClass() return pCharClass; } -void SvtSysLocale_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 nHint ) +void SvtSysLocale_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints nHint ) { MutexGuard aGuard( SvtSysLocale::GetMutex() ); - if ( nHint & SYSLOCALEOPTIONS_HINT_LOCALE ) + if ( nHint & ConfigurationHints::Locale ) { const LanguageTag& rLanguageTag = aSysLocaleOptions.GetRealLanguageTag(); pLocaleData->setLanguageTag( rLanguageTag ); GetCharClass()->setLanguageTag( rLanguageTag ); } - if ( nHint & SYSLOCALEOPTIONS_HINT_DATEPATTERNS ) + if ( nHint & ConfigurationHints::DatePatterns ) { setDateAcceptancePatternsConfig(); } |