diff options
author | Noel Grandin <noel@peralex.com> | 2012-03-08 15:53:57 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-08 16:07:22 +0200 |
commit | 4b4fb33c606fd068e024669efcbd7ad2aefdaacd (patch) | |
tree | 2cea747768a081773303ba0844c0ea0f558530f9 /svtools | |
parent | 1fad074f43e3301420900918881ad1a8b0bc8687 (diff) |
Convert from tools/table.hxx to std::map in SvxMacroTableDtor
In this case, we also convert from storing pointers to storing
the items directly because SvxMacroTableDtor completely controls
the lifecycle of the SvxMacro objects it contains.
Also add an operator== to SvxMacroTableDtor and remove the out-of-line
implementations of equals from two other places.
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/svtools/imapobj.hxx | 4 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlout.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/unoevent.cxx | 5 |
3 files changed, 4 insertions, 7 deletions
diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx index f97850c061de..ee523c596390 100644 --- a/svtools/inc/svtools/imapobj.hxx +++ b/svtools/inc/svtools/imapobj.hxx @@ -152,9 +152,7 @@ inline const SvxMacro& IMapObject::GetEvent( sal_uInt16 nEvent ) const } inline sal_Bool IMapObject::DelEvent( sal_uInt16 nEvent ) { - SvxMacro *pMacro = aEventList.Remove( nEvent ); - delete pMacro; - return ( pMacro != 0 ); + return aEventList.Erase( nEvent ); } #endif diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 3544a0dd5c5a..d35d4af48b11 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -770,7 +770,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, } const SvxMacroTableDtor& rMacroTab = pObj->GetMacroTable(); - if( pEventTable && rMacroTab.Count() ) + if( pEventTable && !rMacroTab.empty() ) Out_Events( rStream, rMacroTab, pEventTable, bOutStarBasic, eDestEnc, pNonConvertableChars ); diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 1a8f9ff9d803..f8894d4a73ab 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -579,9 +579,8 @@ void SvMacroTableEventDescriptor::copyMacrosIntoTable( const sal_uInt16 nEvent = mpSupportedMacroItems[i].mnEvent; if (hasByName(nEvent)) { - SvxMacro* pMacro = new SvxMacro(sEmpty, sEmpty); - getByName(*pMacro, nEvent); - rMacroTable.Insert(nEvent, pMacro); + SvxMacro& rMacro = rMacroTable.Insert(nEvent, SvxMacro(sEmpty, sEmpty)); + getByName(rMacro, nEvent); } } } |