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 /include/svl/style.hxx | |
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 'include/svl/style.hxx')
-rw-r--r-- | include/svl/style.hxx | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/include/svl/style.hxx b/include/svl/style.hxx index 6e0b0b996a9c..69bc70f0dbd2 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -49,24 +49,24 @@ must broadcast this using <SfxStyleSheetBasePool::GetBroadcaster()> broadcasts. The class <SfxStyleSheetHint> is used for this, it contains an Action-Id and a pointer to the <SfxStyleSheetBase>. The actions are: -#define SfxStyleSheetHintId::CREATED // style is created -#define SfxStyleSheetHintId::MODIFIED // style is modified -#define SfxStyleSheetHintId::CHANGED // style is replaced -#define SfxStyleSheetHintId::ERASED // style is deleted +#define SfxHintId::StyleSheetCreated // style is created +#define SfxHintId::StyleSheetModified // style is modified +#define SfxHintId::StyleSheetChanged // style is replaced +#define SfxHintId::StyleSheetErased // style is deleted The following methods already broadcast themself -SfxSimpleHint(SFX_HINT_DYING) from: +SfxSimpleHint(SfxHintId::Dying) from: SfxStyleSheetBasePool::~SfxStyleSheetBasePool() -SfxStyleSheetHint( SfxStyleSheetHintId::CREATED, *p ) from: +SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *p ) from: SfxStyleSheetBasePool::Make( const String& rName, SfxStyleFamily eFam, sal_uInt16 mask) -SfxStyleSheetHint( SfxStyleSheetHintId::CHANGED, *pNew ) from: +SfxStyleSheetHint( SfxHintId::StyleSheetChanged, *pNew ) from: SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet ) -SfxStyleSheetHint( SfxStyleSheetHintId::ERASED, *p ) from: +SfxStyleSheetHint( SfxHintId::StyleSheetErased, *p ) from: SfxStyleSheetBasePool::Erase( SfxStyleSheetBase* p ) SfxStyleSheetBasePool::Clear() */ @@ -292,15 +292,6 @@ public: }; -enum SfxStyleSheetHintId -{ - CREATED = 1, // new - MODIFIED = 2, // changed - CHANGED = 3, // erased and re-created (replaced) - ERASED = 4, // erased - INDESTRUCTION = 5, // in the process of being destructed -}; - class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint { public: @@ -311,14 +302,10 @@ public: class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint { SfxStyleSheetBase* pStyleSh; - sal_uInt16 nHint; - public: - SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& ); + SfxStyleSheetHint( SfxHintId, SfxStyleSheetBase& ); SfxStyleSheetBase* GetStyleSheet() const { return pStyleSh; } - sal_uInt16 GetHint() const - { return nHint; } }; class SVL_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint @@ -326,7 +313,7 @@ class SVL_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint OUString aName; public: - SfxStyleSheetHintExtended( sal_uInt16, const OUString& rOld, + SfxStyleSheetHintExtended( SfxHintId, const OUString& rOld, SfxStyleSheetBase& ); const OUString& GetOldName() const { return aName; } }; |