diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2012-06-10 18:28:02 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-12 23:25:11 +0200 |
commit | 42d57f94fa3202e53f38bfcbef0683c8f0bc1a61 (patch) | |
tree | 6c158b7d57bc6f4663fbea107159618452de12ea /cui | |
parent | Convert SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl) to boost::ptr_vector (diff) | |
download | core-42d57f94fa3202e53f38bfcbef0683c8f0bc1a61.tar.gz core-42d57f94fa3202e53f38bfcbef0683c8f0bc1a61.zip |
Convert SV_DECL_PTRARR_DEL(SvxGroupInfoArr_Impl) to boost::ptr_vector
Change-Id: I90d357107f69ea5939952e9640b5e1f4cbdcec3d
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/selector.cxx | 32 | ||||
-rw-r--r-- | cui/source/inc/selector.hxx | 4 |
2 files changed, 9 insertions, 27 deletions
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 21b5e61858a3..012bd6b61a9a 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -76,8 +76,6 @@ using namespace ::com::sun::star::container; #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> -SV_IMPL_PTRARR(SvxGroupInfoArr_Impl, SvxGroupInfoPtr); - /* * The implementations of SvxConfigFunctionListBox_Impl and * SvxConfigGroupListBox_Impl are copied from sfx2/source/dialog/cfg.cxx @@ -140,14 +138,7 @@ IMPL_LINK_NOARG(SvxConfigFunctionListBox_Impl, TimerHdl) void SvxConfigFunctionListBox_Impl::ClearAll() { - sal_uInt16 nCount = aArr.Count(); - for ( sal_uInt16 i=0; i<nCount; ++i ) - { - SvxGroupInfo_Impl *pData = aArr[i]; - delete pData; - } - - aArr.Remove( 0, nCount ); + aArr.clear(); Clear(); } @@ -236,14 +227,7 @@ SvxConfigGroupListBox_Impl::~SvxConfigGroupListBox_Impl() void SvxConfigGroupListBox_Impl::ClearAll() { - sal_uInt16 nCount = aArr.Count(); - for ( sal_uInt16 i=0; i<nCount; ++i ) - { - SvxGroupInfo_Impl *pData = aArr[i]; - delete pData; - } - - aArr.Remove( 0, nCount ); + aArr.clear(); Clear(); } @@ -376,7 +360,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows SvxGroupInfo_Impl* pInfo = new SvxGroupInfo_Impl( SVX_CFGGROUP_SCRIPTCONTAINER, 0, theChild ); pNewEntry->SetUserData( pInfo ); - aArr.Insert( pInfo, aArr.Count() ); + aArr.push_back( pInfo ); if ( _bCheapChildrenOnDemand ) { @@ -524,7 +508,7 @@ void SvxConfigGroupListBox_Impl::Init() SvxGroupInfo_Impl *pInfo = new SvxGroupInfo_Impl( SVX_CFGGROUP_FUNCTION, gids[i] ); - aArr.Insert( pInfo, aArr.Count() ); + aArr.push_back( pInfo ); pEntry->SetUserData( pInfo ); } @@ -564,7 +548,7 @@ void SvxConfigGroupListBox_Impl::Init() SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); pNewEntry->SetUserData( pInfo ); pNewEntry->EnableChildrenOnDemand( sal_True ); - aArr.Insert( pInfo, aArr.Count() ); + aArr.push_back( pInfo ); } else { @@ -772,8 +756,7 @@ void SvxConfigGroupListBox_Impl::GroupSelected() SvxGroupInfo_Impl *_pGroupInfo = new SvxGroupInfo_Impl( SVX_CFGFUNCTION_SLOT, 123, aCmdURL, ::rtl::OUString() ); - pFunctionListBox->aArr.Insert( - _pGroupInfo, pFunctionListBox->aArr.Count() ); + pFunctionListBox->aArr.push_back( _pGroupInfo ); pFuncEntry->SetUserData( _pGroupInfo ); } @@ -832,8 +815,7 @@ void SvxConfigGroupListBox_Impl::GroupSelected() pNewEntry->SetUserData( _pGroupInfo ); - pFunctionListBox->aArr.Insert( - _pGroupInfo, pFunctionListBox->aArr.Count() ); + pFunctionListBox->aArr.push_back( _pGroupInfo ); } } diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx index d515c5371356..2bad5986a33f 100644 --- a/cui/source/inc/selector.hxx +++ b/cui/source/inc/selector.hxx @@ -40,6 +40,7 @@ #include <com/sun/star/script/browse/XBrowseNode.hpp> #include <sfx2/minarray.hxx> +#include <boost/ptr_container/ptr_vector.hpp> #define SVX_CFGGROUP_FUNCTION 1 #define SVX_CFGFUNCTION_SLOT 2 @@ -87,8 +88,7 @@ struct SvxGroupInfo_Impl } }; -typedef SvxGroupInfo_Impl* SvxGroupInfoPtr; -SV_DECL_PTRARR_DEL(SvxGroupInfoArr_Impl, SvxGroupInfoPtr, 5) +typedef boost::ptr_vector<SvxGroupInfo_Impl> SvxGroupInfoArr_Impl; class ImageProvider { |