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 /svl/source | |
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 'svl/source')
-rw-r--r-- | svl/source/items/macitem.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 627daa9330dd..9bf75713b6d9 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -131,7 +131,7 @@ void SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion ) if( SVX_MACROTBL_VERSION40 <= nVersion ) rStrm.ReadUInt16( eType ); - aSvxMacroTable.insert( SvxMacroTable::value_type(nCurKey, SvxMacro( aMacName, aLibName, (ScriptType)eType ) )); + aSvxMacroTable.insert( SvxMacroTable::value_type(SvMacroItemId(nCurKey), SvxMacro( aMacName, aLibName, (ScriptType)eType ) )); } } @@ -151,7 +151,7 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const while( it != aSvxMacroTable.end() && rStream.GetError() == ERRCODE_NONE ) { const SvxMacro& rMac = it->second; - rStream.WriteUInt16( it->first ); + rStream.WriteUInt16( (sal_uInt16)it->first ); writeByteString(rStream, rMac.GetLibName()); writeByteString(rStream, rMac.GetMacName()); @@ -163,34 +163,34 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const } // returns NULL if no entry exists, or a pointer to the internal value -const SvxMacro* SvxMacroTableDtor::Get(sal_uInt16 nEvent) const +const SvxMacro* SvxMacroTableDtor::Get(SvMacroItemId nEvent) const { SvxMacroTable::const_iterator it = aSvxMacroTable.find(nEvent); return it == aSvxMacroTable.end() ? nullptr : &(it->second); } // returns NULL if no entry exists, or a pointer to the internal value -SvxMacro* SvxMacroTableDtor::Get(sal_uInt16 nEvent) +SvxMacro* SvxMacroTableDtor::Get(SvMacroItemId nEvent) { SvxMacroTable::iterator it = aSvxMacroTable.find(nEvent); return it == aSvxMacroTable.end() ? nullptr : &(it->second); } // return true if the key exists -bool SvxMacroTableDtor::IsKeyValid(sal_uInt16 nEvent) const +bool SvxMacroTableDtor::IsKeyValid(SvMacroItemId nEvent) const { SvxMacroTable::const_iterator it = aSvxMacroTable.find(nEvent); return it != aSvxMacroTable.end(); } // This stores a copy of the rMacro parameter -SvxMacro& SvxMacroTableDtor::Insert(sal_uInt16 nEvent, const SvxMacro& rMacro) +SvxMacro& SvxMacroTableDtor::Insert(SvMacroItemId nEvent, const SvxMacro& rMacro) { return aSvxMacroTable.insert( SvxMacroTable::value_type( nEvent, rMacro ) ).first->second; } // If the entry exists, remove it from the map and release it's storage -void SvxMacroTableDtor::Erase(sal_uInt16 nEvent) +void SvxMacroTableDtor::Erase(SvMacroItemId nEvent) { SvxMacroTable::iterator it = aSvxMacroTable.find(nEvent); if ( it != aSvxMacroTable.end()) @@ -259,7 +259,7 @@ SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const } -void SvxMacroItem::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro ) +void SvxMacroItem::SetMacro( SvMacroItemId nEvent, const SvxMacro& rMacro ) { aMacroTable.Insert( nEvent, rMacro); } |