Kaydet (Commit) 42d57f94 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL(SvxGroupInfoArr_Impl) to boost::ptr_vector

Change-Id: I90d357107f69ea5939952e9640b5e1f4cbdcec3d
üst 4449da41
...@@ -76,8 +76,6 @@ using namespace ::com::sun::star::container; ...@@ -76,8 +76,6 @@ using namespace ::com::sun::star::container;
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
SV_IMPL_PTRARR(SvxGroupInfoArr_Impl, SvxGroupInfoPtr);
/* /*
* The implementations of SvxConfigFunctionListBox_Impl and * The implementations of SvxConfigFunctionListBox_Impl and
* SvxConfigGroupListBox_Impl are copied from sfx2/source/dialog/cfg.cxx * SvxConfigGroupListBox_Impl are copied from sfx2/source/dialog/cfg.cxx
...@@ -140,14 +138,7 @@ IMPL_LINK_NOARG(SvxConfigFunctionListBox_Impl, TimerHdl) ...@@ -140,14 +138,7 @@ IMPL_LINK_NOARG(SvxConfigFunctionListBox_Impl, TimerHdl)
void SvxConfigFunctionListBox_Impl::ClearAll() void SvxConfigFunctionListBox_Impl::ClearAll()
{ {
sal_uInt16 nCount = aArr.Count(); aArr.clear();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
SvxGroupInfo_Impl *pData = aArr[i];
delete pData;
}
aArr.Remove( 0, nCount );
Clear(); Clear();
} }
...@@ -236,14 +227,7 @@ SvxConfigGroupListBox_Impl::~SvxConfigGroupListBox_Impl() ...@@ -236,14 +227,7 @@ SvxConfigGroupListBox_Impl::~SvxConfigGroupListBox_Impl()
void SvxConfigGroupListBox_Impl::ClearAll() void SvxConfigGroupListBox_Impl::ClearAll()
{ {
sal_uInt16 nCount = aArr.Count(); aArr.clear();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
SvxGroupInfo_Impl *pData = aArr[i];
delete pData;
}
aArr.Remove( 0, nCount );
Clear(); Clear();
} }
...@@ -376,7 +360,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows ...@@ -376,7 +360,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows
SvxGroupInfo_Impl* pInfo = SvxGroupInfo_Impl* pInfo =
new SvxGroupInfo_Impl( SVX_CFGGROUP_SCRIPTCONTAINER, 0, theChild ); new SvxGroupInfo_Impl( SVX_CFGGROUP_SCRIPTCONTAINER, 0, theChild );
pNewEntry->SetUserData( pInfo ); pNewEntry->SetUserData( pInfo );
aArr.Insert( pInfo, aArr.Count() ); aArr.push_back( pInfo );
if ( _bCheapChildrenOnDemand ) if ( _bCheapChildrenOnDemand )
{ {
...@@ -524,7 +508,7 @@ void SvxConfigGroupListBox_Impl::Init() ...@@ -524,7 +508,7 @@ void SvxConfigGroupListBox_Impl::Init()
SvxGroupInfo_Impl *pInfo = SvxGroupInfo_Impl *pInfo =
new SvxGroupInfo_Impl( SVX_CFGGROUP_FUNCTION, gids[i] ); new SvxGroupInfo_Impl( SVX_CFGGROUP_FUNCTION, gids[i] );
aArr.Insert( pInfo, aArr.Count() ); aArr.push_back( pInfo );
pEntry->SetUserData( pInfo ); pEntry->SetUserData( pInfo );
} }
...@@ -564,7 +548,7 @@ void SvxConfigGroupListBox_Impl::Init() ...@@ -564,7 +548,7 @@ void SvxConfigGroupListBox_Impl::Init()
SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL );
pNewEntry->SetUserData( pInfo ); pNewEntry->SetUserData( pInfo );
pNewEntry->EnableChildrenOnDemand( sal_True ); pNewEntry->EnableChildrenOnDemand( sal_True );
aArr.Insert( pInfo, aArr.Count() ); aArr.push_back( pInfo );
} }
else else
{ {
...@@ -772,8 +756,7 @@ void SvxConfigGroupListBox_Impl::GroupSelected() ...@@ -772,8 +756,7 @@ void SvxConfigGroupListBox_Impl::GroupSelected()
SvxGroupInfo_Impl *_pGroupInfo = new SvxGroupInfo_Impl( SvxGroupInfo_Impl *_pGroupInfo = new SvxGroupInfo_Impl(
SVX_CFGFUNCTION_SLOT, 123, aCmdURL, ::rtl::OUString() ); SVX_CFGFUNCTION_SLOT, 123, aCmdURL, ::rtl::OUString() );
pFunctionListBox->aArr.Insert( pFunctionListBox->aArr.push_back( _pGroupInfo );
_pGroupInfo, pFunctionListBox->aArr.Count() );
pFuncEntry->SetUserData( _pGroupInfo ); pFuncEntry->SetUserData( _pGroupInfo );
} }
...@@ -832,8 +815,7 @@ void SvxConfigGroupListBox_Impl::GroupSelected() ...@@ -832,8 +815,7 @@ void SvxConfigGroupListBox_Impl::GroupSelected()
pNewEntry->SetUserData( _pGroupInfo ); pNewEntry->SetUserData( _pGroupInfo );
pFunctionListBox->aArr.Insert( pFunctionListBox->aArr.push_back( _pGroupInfo );
_pGroupInfo, pFunctionListBox->aArr.Count() );
} }
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <com/sun/star/script/browse/XBrowseNode.hpp> #include <com/sun/star/script/browse/XBrowseNode.hpp>
#include <sfx2/minarray.hxx> #include <sfx2/minarray.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#define SVX_CFGGROUP_FUNCTION 1 #define SVX_CFGGROUP_FUNCTION 1
#define SVX_CFGFUNCTION_SLOT 2 #define SVX_CFGFUNCTION_SLOT 2
...@@ -87,8 +88,7 @@ struct SvxGroupInfo_Impl ...@@ -87,8 +88,7 @@ struct SvxGroupInfo_Impl
} }
}; };
typedef SvxGroupInfo_Impl* SvxGroupInfoPtr; typedef boost::ptr_vector<SvxGroupInfo_Impl> SvxGroupInfoArr_Impl;
SV_DECL_PTRARR_DEL(SvxGroupInfoArr_Impl, SvxGroupInfoPtr, 5)
class ImageProvider class ImageProvider
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment