diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-08 10:26:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-08 12:35:09 +0000 |
commit | a66731982e93cdcc5beaa5b0586a7f12a7fc0ef6 (patch) | |
tree | 19064090be4d97781c16aa6e79a4f7a09d561ae9 /svl | |
parent | 20475c78db5c62f2c8711e59753476bd9b4e2f1c (diff) |
convert SFX_HINT to scoped enum
Notes
(*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a
dynamic_cast check.
(*) In SC, removed the hint id field from ScIndexHint, no point in
storing the hint id twice
(*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no
point in storing two different hint ids
(*) In some cases, multiple #define's used to map to the same SFX_HINT
value (notably the SFX_HINT_USER* values). I made all of those separate
values.
Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5
Reviewed-on: https://gerrit.libreoffice.org/31751
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/itempool.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 29 | ||||
-rw-r--r-- | svl/source/notify/SfxBroadcaster.cxx | 2 | ||||
-rw-r--r-- | svl/source/notify/broadcast.cxx | 2 |
4 files changed, 17 insertions, 18 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index c61fec457129..27caf7c2e708 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -488,7 +488,7 @@ void SfxItemPool::Delete() return; // Inform e.g. running Requests - pImpl->aBC.Broadcast( SfxHint( SFX_HINT_DYING ) ); + pImpl->aBC.Broadcast( SfxHint( SfxHintId::Dying ) ); // Iterate through twice: first for the SetItems. if (pImpl->ppStaticDefaults != nullptr) { diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 63842fdaa655..a96cc5f22019 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -62,7 +62,7 @@ aDbgStyleSheetReferences; SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - sal_uInt16 nAction, // SfxStyleSheetHintId::... (see above) + SfxHintId nAction, const OUString& rOldName, SfxStyleSheetBase& rStyleSheet // Remains with the caller ) @@ -73,11 +73,10 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended SfxStyleSheetHint::SfxStyleSheetHint ( - sal_uInt16 nAction, // SfxStyleSheetHintId::... (see above) + SfxHintId nAction, SfxStyleSheetBase& rStyleSheet // Remains with the caller ) -: pStyleSh( &rStyleSheet ), - nHint( nAction ) +: SfxHint(nAction), pStyleSh( &rStyleSheet ) {} @@ -187,7 +186,7 @@ bool SfxStyleSheetBase::SetName(const OUString& rName, bool bReIndexNow) pPool->Reindex(); pPool->SetSearchMask(eTmpFam, nTmpMask); pPool->Broadcast( SfxStyleSheetHintExtended( - SfxStyleSheetHintId::MODIFIED, aOldName, *this ) ); + SfxHintId::StyleSheetModified, aOldName, *this ) ); } return true; } @@ -235,14 +234,14 @@ bool SfxStyleSheetBase::SetParent( const OUString& rName ) } aParent = rName; } - pPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED, *this ) ); + pPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified, *this ) ); return true; } void SfxStyleSheetBase::SetHidden( bool hidden ) { bHidden = hidden; - pPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED, *this ) ); + pPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified, *this ) ); } /** @@ -264,7 +263,7 @@ bool SfxStyleSheetBase::SetFollow( const OUString& rName ) } aFollow = rName; } - pPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::MODIFIED, *this ) ); + pPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetModified, *this ) ); return true; } @@ -606,7 +605,7 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool() aDbgStyleSheetReferences.mnPools--; #endif - Broadcast( SfxHint(SFX_HINT_DYING) ); + Broadcast( SfxHint(SfxHintId::Dying) ); Clear(); } @@ -664,7 +663,7 @@ SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleF { xStyle = Create( rName, eFam, mask ); StoreStyleSheet(xStyle); - Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::CREATED, *xStyle.get() ) ); + Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *xStyle.get() ) ); } return *xStyle.get(); } @@ -682,7 +681,7 @@ void SfxStyleSheetBasePool::Add( const SfxStyleSheetBase& rSheet ) } rtl::Reference< SfxStyleSheetBase > xNew( Create( rSheet ) ); pImpl->mxIndexedStyleSheets->AddStyleSheet(xNew); - Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::CHANGED, *xNew.get() ) ); + Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetChanged, *xNew.get() ) ); } SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator=( const SfxStyleSheetBasePool& r ) @@ -773,7 +772,7 @@ void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p ) // catch( css::uno::Exception& ) // { // } - Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::ERASED, *p ) ); + Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetErased, *p ) ); } } } @@ -793,7 +792,7 @@ void SfxStyleSheetBasePool::Insert( SfxStyleSheetBase* p ) } #endif StoreStyleSheet(rtl::Reference< SfxStyleSheetBase >( p ) ); - Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::CREATED, *p ) ); + Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *p ) ); } namespace @@ -816,7 +815,7 @@ struct StyleSheetDisposerFunctor final : public svl::StyleSheetDisposer catch( css::uno::Exception& ) { } - mPool->Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::ERASED, *styleSheet.get() ) ); + mPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetErased, *styleSheet.get() ) ); } SfxStyleSheetBasePool* mPool; @@ -871,7 +870,7 @@ SfxStyleSheet::SfxStyleSheet(const SfxStyleSheet& rStyle) SfxStyleSheet::~SfxStyleSheet() { - Broadcast( SfxStyleSheetHint( SfxStyleSheetHintId::INDESTRUCTION, *this ) ); + Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetInDestruction, *this ) ); } diff --git a/svl/source/notify/SfxBroadcaster.cxx b/svl/source/notify/SfxBroadcaster.cxx index 3b069b1989fc..089628112b71 100644 --- a/svl/source/notify/SfxBroadcaster.cxx +++ b/svl/source/notify/SfxBroadcaster.cxx @@ -55,7 +55,7 @@ void SfxBroadcaster::Broadcast( const SfxHint &rHint ) SfxBroadcaster::~SfxBroadcaster() { - Broadcast( SfxHint(SFX_HINT_DYING) ); + Broadcast( SfxHint(SfxHintId::Dying) ); // remove all still registered listeners for (size_t i = 0; i < mpImpl->m_Listeners.size(); ++i) diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx index cd110e19e66e..237c323e5d0b 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.cxx @@ -101,7 +101,7 @@ SvtBroadcaster::SvtBroadcaster( const SvtBroadcaster &rBC ) : SvtBroadcaster::~SvtBroadcaster() { mbDisposing = true; - Broadcast( SfxHint(SFX_HINT_DYING) ); + Broadcast( SfxHint(SfxHintId::Dying) ); Normalize(); |