summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-03-08 15:53:57 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-03-08 16:07:22 +0200
commit4b4fb33c606fd068e024669efcbd7ad2aefdaacd (patch)
tree2cea747768a081773303ba0844c0ea0f558530f9 /cui
parent1fad074f43e3301420900918881ad1a8b0bc8687 (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 'cui')
-rw-r--r--cui/source/inc/macroass.hxx2
-rw-r--r--cui/source/tabpages/macroass.cxx7
2 files changed, 4 insertions, 5 deletions
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 849ac45285ce..bca7bf490cd0 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -100,7 +100,7 @@ inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
inline void _SfxMacroTabPage::ClearMacroTbl()
{
- aTbl.DelDtor();
+ aTbl.clear();
}
class SfxMacroTabPage : public _SfxMacroTabPage
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 3128df1ec49c..62f38c2eafab 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -329,8 +329,7 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
// aus der Tabelle entfernen
sal_uInt16 nEvent = (sal_uInt16)(sal_uLong)pE->GetUserData();
- SvxMacro *pRemoveMacro = pThis->aTbl.Remove( nEvent );
- delete pRemoveMacro;
+ pThis->aTbl.Erase( nEvent );
String sScriptURI;
if( bAssEnabled )
@@ -339,13 +338,13 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
if( sScriptURI.CompareToAscii( "vnd.sun.star.script:", 20 ) == COMPARE_EQUAL )
{
pThis->aTbl.Insert(
- nEvent, new SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_SF ) ) );
+ nEvent, SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_SF ) ) );
}
else
{
OSL_ENSURE( false, "_SfxMacroTabPage::AssignDeleteHdl_Impl: this branch is *not* dead? (out of interest: tell fs, please!)" );
pThis->aTbl.Insert(
- nEvent, new SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_STARBASIC ) ) );
+ nEvent, SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_STARBASIC ) ) );
}
}