summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 10:03:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-25 12:21:22 +0200
commit31a85a9a13595a9aeae1932ee08c9b09ead384cd (patch)
treed3cf4136e21a3acee1ddbf77aca62f3d73c3ed55 /cui
parent2fffaf6f05d829e345ad8b391646a6e8df9a9a26 (diff)
convert UNO event ids to scoped enum
I'm fairly sure there are more simplifications that could be make here. It seems like we have both an ID and a string name for all of these events, and we could probably get by with just one of those, or alternately, centralise the name<->id mapping somewhere Change-Id: I978073822ddbebce94ac5b560fea675bea905a35 Reviewed-on: https://gerrit.libreoffice.org/40392 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/hltpbase.cxx6
-rw-r--r--cui/source/inc/macroass.hxx2
-rw-r--r--cui/source/tabpages/macroass.cxx8
3 files changed, 8 insertions, 8 deletions
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 68afa3cb9433..bae6b299bd78 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -342,13 +342,13 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, void)
if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseOverObject )
pMacroPage->AddEvent( CuiResId(RID_SVXSTR_HYPDLG_MACROACT1),
- SFX_EVENT_MOUSEOVER_OBJECT );
+ SvMacroItemId::OnMouseOver );
if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseClickObject )
pMacroPage->AddEvent( CuiResId(RID_SVXSTR_HYPDLG_MACROACT2),
- SFX_EVENT_MOUSECLICK_OBJECT);
+ SvMacroItemId::OnClick);
if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseOutObject )
pMacroPage->AddEvent( CuiResId(RID_SVXSTR_HYPDLG_MACROACT3),
- SFX_EVENT_MOUSEOUT_OBJECT);
+ SvMacroItemId::OnMouseOut);
if ( bIsInputEnabled )
GetParent()->EnableInput();
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 3f37b3a260a2..e7fcd756e29f 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -62,7 +62,7 @@ public:
virtual ~SfxMacroTabPage() override;
virtual void dispose() override;
- void AddEvent( const OUString & rEventName, sal_uInt16 nEventId );
+ void AddEvent( const OUString & rEventName, SvMacroItemId nEventId );
void ScriptChanged();
virtual void PageCreated (const SfxAllItemSet& aSet) override;
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 79c0fcd6f64c..a2b61d49e812 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -117,7 +117,7 @@ void SfxMacroTabPage::EnableButtons()
if ( pE )
{
// get bound macro
- const SvxMacro* pM = aTbl.Get( (sal_uInt16)reinterpret_cast<sal_uLong>(pE->GetUserData()) );
+ const SvxMacro* pM = aTbl.Get( (SvMacroItemId)reinterpret_cast<sal_uLong>(pE->GetUserData()) );
mpImpl->pDeletePB->Enable( nullptr != pM );
OUString sEventMacro = static_cast<const SvLBoxString&>(pE->GetItem( LB_MACROS_ITEMPOS )).GetText();
@@ -167,7 +167,7 @@ void SfxMacroTabPage::dispose()
SfxTabPage::dispose();
}
-void SfxMacroTabPage::AddEvent( const OUString & rEventName, sal_uInt16 nEventId )
+void SfxMacroTabPage::AddEvent( const OUString & rEventName, SvMacroItemId nEventId )
{
OUString sTmp = rEventName + "\t";
@@ -325,7 +325,7 @@ bool SfxMacroTabPage::AssignDeleteHdl(Control* pBtn)
const bool bAssEnabled = pBtn != mpImpl->pDeletePB && mpImpl->pAssignPB->IsEnabled();
// remove from the table
- sal_uInt16 nEvent = (sal_uInt16)reinterpret_cast<sal_uLong>(pE->GetUserData());
+ SvMacroItemId nEvent = (SvMacroItemId)reinterpret_cast<sal_uLong>(pE->GetUserData());
aTbl.Erase( nEvent );
OUString sScriptURI;
@@ -428,7 +428,7 @@ void SfxMacroTabPage::FillEvents()
OUString sOld( rLItem.GetText() );
OUString sNew;
- sal_uInt16 nEventId = ( sal_uInt16 ) reinterpret_cast<sal_uLong>( pE->GetUserData() );
+ SvMacroItemId nEventId = (SvMacroItemId) reinterpret_cast<sal_uLong>( pE->GetUserData() );
if( aTbl.IsKeyValid( nEventId ) )
sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ) );