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 /starmath | |
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 'starmath')
-rw-r--r-- | starmath/inc/format.hxx | 5 | ||||
-rw-r--r-- | starmath/source/cfgitem.cxx | 2 | ||||
-rw-r--r-- | starmath/source/document.cxx | 12 | ||||
-rw-r--r-- | starmath/source/view.cxx | 4 |
4 files changed, 9 insertions, 14 deletions
diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index c49655f2a0e4..7dc1a9c32930 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -82,9 +82,6 @@ #define DIS_END 23 -// to be broadcasted on format changes: -#define HINT_FORMATCHANGED 10003 - enum SmHorAlign { AlignLeft, AlignCenter, AlignRight }; OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ); @@ -140,7 +137,7 @@ public: void RequestApplyChanges() { - Broadcast(SfxHint(HINT_FORMATCHANGED)); + Broadcast(SfxHint(SfxHintId::MathFormatChanged)); } }; diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index b849bdd4e0be..1ea663b8ddb9 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -1188,7 +1188,7 @@ void SmMathConfig::ItemSetToConfig(const SfxItemSet &rSet) SetIgnoreSpacesRight( bVal ); // reformat (displayed) formulas accordingly - Broadcast(SfxHint(HINT_FORMATCHANGED)); + Broadcast(SfxHint(SfxHintId::MathFormatChanged)); } } if (rSet.GetItemState(SID_SAVE_ONLY_USED_SYMBOLS, true, &pItem) == SfxItemState::SET) diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 142bc78f9f28..87c1961d431a 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -115,15 +115,13 @@ SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), SfxObjectShellF void SmDocShell::Notify(SfxBroadcaster&, const SfxHint& rHint) { - switch (rHint.GetId()) + if (rHint.GetId() == SfxHintId::MathFormatChanged) { - case HINT_FORMATCHANGED: - SetFormulaArranged(false); + SetFormulaArranged(false); - mnModifyCount++; //! see comment for SID_GAPHIC_SM in SmDocShell::GetState + mnModifyCount++; //! see comment for SID_GAPHIC_SM in SmDocShell::GetState - Repaint(); - break; + Repaint(); } } @@ -1312,7 +1310,7 @@ void SmDocShell::SetModified(bool bModified) if( IsEnableSetModified() ) { SfxObjectShell::SetModified( bModified ); - Broadcast(SfxHint(SFX_HINT_DOCCHANGED)); + Broadcast(SfxHint(SfxHintId::DocChanged)); } } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 00bae3b48c3f..4486a89bbd27 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2043,8 +2043,8 @@ void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint ) { switch( rHint.GetId() ) { - case SFX_HINT_MODECHANGED: - case SFX_HINT_DOCCHANGED: + case SfxHintId::ModeChanged: + case SfxHintId::DocChanged: GetViewFrame()->GetBindings().InvalidateAll(false); break; default: |