diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-25 10:03:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-25 12:21:22 +0200 |
commit | 31a85a9a13595a9aeae1932ee08c9b09ead384cd (patch) | |
tree | d3cf4136e21a3acee1ddbf77aca62f3d73c3ed55 /svx | |
parent | 2fffaf6f05d829e345ad8b391646a6e8df9a9a26 (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 'svx')
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/hlnkitem.cxx | 12 | ||||
-rw-r--r-- | svx/source/unodraw/unomod.cxx | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index faa784d4b506..ce44fc65a89e 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -637,8 +637,8 @@ void IMapWindow::DoMacroAssign() SfxItemSet aSet( *pIMapPool, svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>{} ); SfxEventNamesItem aNamesItem(SID_EVENTCONFIG); - aNamesItem.AddEvent( "MouseOver", "", SFX_EVENT_MOUSEOVER_OBJECT ); - aNamesItem.AddEvent( "MouseOut", "", SFX_EVENT_MOUSEOUT_OBJECT ); + aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver ); + aNamesItem.AddEvent( "MouseOut", "", SvMacroItemId::OnMouseOut ); aSet.Put( aNamesItem ); SvxMacroItem aMacroItem(SID_ATTR_MACROITEM); diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index 01f6c024fcf0..2627e738b05d 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -75,7 +75,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ const SvxMacro& rMac = it->second; if( STARBASIC == rMac.GetScriptType() ) { - rStrm.WriteUInt16( it->first ); + rStrm.WriteUInt16( sal_uInt16(it->first) ); // UNICODE: rStrm << pMac->GetLibName(); rStrm.WriteUniOrByteString(rMac.GetLibName(), rStrm.GetStreamCharSet()); @@ -97,7 +97,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ const SvxMacro& rMac = it->second; if( STARBASIC != rMac.GetScriptType() ) { - rStrm.WriteUInt16( it->first ); + rStrm.WriteUInt16( sal_uInt16(it->first) ); // UNICODE: rStrm << pMac->GetLibName(); rStrm.WriteUniOrByteString(rMac.GetLibName(), rStrm.GetStreamCharSet()); @@ -253,17 +253,17 @@ bool SvxHyperlinkItem::operator==( const SfxPoolItem& rAttr ) const void SvxHyperlinkItem::SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro ) { - sal_uInt16 nSfxEvent = 0; + SvMacroItemId nSfxEvent = SvMacroItemId::NONE; switch( nEvent ) { case HyperDialogEvent::MouseOverObject: - nSfxEvent = SFX_EVENT_MOUSEOVER_OBJECT; + nSfxEvent = SvMacroItemId::OnMouseOver; break; case HyperDialogEvent::MouseClickObject: - nSfxEvent = SFX_EVENT_MOUSECLICK_OBJECT; + nSfxEvent = SvMacroItemId::OnClick; break; case HyperDialogEvent::MouseOutObject: - nSfxEvent = SFX_EVENT_MOUSEOUT_OBJECT; + nSfxEvent = SvMacroItemId::OnMouseOut; break; default: break; } diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 4aac08018752..3de01ff87b20 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -99,9 +99,9 @@ static const SvEventDescription* ImplGetSupportedMacroItems() { static const SvEventDescription aMacroDescriptionsImpl[] = { - { SFX_EVENT_MOUSEOVER_OBJECT, "OnMouseOver" }, - { SFX_EVENT_MOUSEOUT_OBJECT, "OnMouseOut" }, - { 0, nullptr } + { SvMacroItemId::OnMouseOver, "OnMouseOver" }, + { SvMacroItemId::OnMouseOut, "OnMouseOut" }, + { SvMacroItemId::NONE, nullptr } }; return aMacroDescriptionsImpl; |