summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx9
-rw-r--r--sfx2/source/config/evntconf.cxx2
2 files changed, 6 insertions, 5 deletions
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index a066fd8c615c..ee2137a3ed56 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -22,6 +22,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
+#include <sfx2/event.hxx>
#include "openflag.hxx"
#include <svtools/htmlkywd.hxx>
@@ -102,8 +103,8 @@ bool SfxHTMLParser::ParseMapOptions(
bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBaseURL,
const HTMLOptions& rOptions,
- sal_uInt16 nEventMouseOver,
- sal_uInt16 nEventMouseOut )
+ SvMacroItemId nEventMouseOver,
+ SvMacroItemId nEventMouseOut )
{
DBG_ASSERT( pImageMap, "ParseAreaOptions: no Image-Map" );
@@ -115,7 +116,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBase
for (size_t i = rOptions.size(); i; )
{
- sal_uInt16 nEvent = 0;
+ SvMacroItemId nEvent = SvMacroItemId::NONE;
ScriptType eScrpType = STARBASIC;
const HTMLOption& rOption = rOptions[--i];
switch( rOption.GetToken() )
@@ -156,7 +157,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBase
nEvent = nEventMouseOut;
goto IMAPOBJ_SETEVENT;
IMAPOBJ_SETEVENT:
- if( nEvent )
+ if( nEvent != SvMacroItemId::NONE)
{
OUString sTmp( rOption.GetString() );
if( !sTmp.isEmpty() )
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 21369698b772..eed3e1cbd47a 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -126,7 +126,7 @@ sal_uInt16 SfxEventNamesItem::GetVersion( sal_uInt16 ) const
return 0;
}
-void SfxEventNamesItem::AddEvent( const OUString& rName, const OUString& rUIName, sal_uInt16 nID )
+void SfxEventNamesItem::AddEvent( const OUString& rName, const OUString& rUIName, SvMacroItemId nID )
{
aEventsList.push_back( new SfxEventName( nID, rName, !rUIName.isEmpty() ? rUIName : rName ) );
}