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 /basctl | |
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 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 14 | ||||
-rw-r--r-- | basctl/source/basicide/basidesh.cxx | 20 |
2 files changed, 15 insertions, 19 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 33fbf526b93d..2ae1b955d8d8 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1038,7 +1038,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) if (TextHint const* pTextHint = dynamic_cast<TextHint const*>(&rHint)) { TextHint const& rTextHint = *pTextHint; - if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED ) + if( rTextHint.GetId() == SfxHintId::TextViewScrolled ) { if ( rModulWindow.GetHScrollBar() ) rModulWindow.GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); @@ -1048,7 +1048,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) rModulWindow.GetLineNumberWindow().DoScroll ( rModulWindow.GetLineNumberWindow().GetCurYOffset() - pEditView->GetStartDocPos().Y() ); } - else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED ) + else if( rTextHint.GetId() == SfxHintId::TextHeightChanged ) { if ( pEditView->GetStartDocPos().Y() ) { @@ -1062,7 +1062,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) SetScrollBarRanges(); } - else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED ) + else if( rTextHint.GetId() == SfxHintId::TextFormatted ) { if ( rModulWindow.GetHScrollBar() ) { @@ -1079,20 +1079,20 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) if ( nCurTextWidth != nPrevTextWidth ) SetScrollBarRanges(); } - else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) + else if( rTextHint.GetId() == SfxHintId::TextParaInserted ) { ParagraphInsertedDeleted( rTextHint.GetValue(), true ); DoDelayedSyntaxHighlight( rTextHint.GetValue() ); } - else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED ) + else if( rTextHint.GetId() == SfxHintId::TextParaRemoved ) { ParagraphInsertedDeleted( rTextHint.GetValue(), false ); } - else if( rTextHint.GetId() == TEXT_HINT_PARACONTENTCHANGED ) + else if( rTextHint.GetId() == SfxHintId::TextParaContentChanged ) { DoDelayedSyntaxHighlight( rTextHint.GetValue() ); } - else if( rTextHint.GetId() == TEXT_HINT_VIEWSELECTIONCHANGED ) + else if( rTextHint.GetId() == SfxHintId::TextViewSelectionChanged ) { if (SfxBindings* pBindings = GetBindingsPtr()) { diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 762b90b43b0a..90e093ae885e 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -475,21 +475,17 @@ void Shell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { if (GetShell()) { - switch (rHint.GetId()) + if (rHint.GetId() == SfxHintId::Dying) { - case SFX_HINT_DYING: - { - EndListening( rBC, true /* log off all */ ); - aObjectCatalog->UpdateEntries(); - } - break; + EndListening( rBC, true /* log off all */ ); + aObjectCatalog->UpdateEntries(); } if (SbxHint const* pSbxHint = dynamic_cast<SbxHint const*>(&rHint)) { - const sal_uInt32 nHintId = pSbxHint->GetId(); - if ( ( nHintId == SBX_HINT_BASICSTART ) || - ( nHintId == SBX_HINT_BASICSTOP ) ) + const SfxHintId nHintId = pSbxHint->GetId(); + if ( ( nHintId == SfxHintId::BasicStart ) || + ( nHintId == SfxHintId::BasicStop ) ) { if (SfxBindings* pBindings = GetBindingsPtr()) { @@ -515,7 +511,7 @@ void Shell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pBindings->Update( SID_BASICLOAD ); } - if ( nHintId == SBX_HINT_BASICSTOP ) + if ( nHintId == SfxHintId::BasicStop ) { // not only at error/break or explicit stoppage, // if the update is turned off due to a programming bug @@ -533,7 +529,7 @@ void Shell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it) { BaseWindow* pWin = it->second; - if ( nHintId == SBX_HINT_BASICSTART ) + if ( nHintId == SfxHintId::BasicStart ) pWin->BasicStarted(); else pWin->BasicStopped(); |