diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-12 08:42:28 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-12 23:25:09 +0200 |
commit | e19a2e50b723e0871d10cb51198d82c3dc8e57fa (patch) | |
tree | 4293005023e070d931422fb3c04aa40a7ecb3030 /filter/source | |
parent | 9536a28ede89e8c29940e8ba225215a45667062c (diff) |
Convert SV_DECL_PTRARR_DEL(SvxMSDffShapeOrders) to std::vector
I could not use boost::ptr_vector because some of the code copies
the pointers into other data-structures temporarily, which
ptr_vector does not like.
Change-Id: Ie9c8aeb4e741bfd138694929ccda451a1c0984bb
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 21eb7689578b..e010d616be52 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -5659,11 +5659,10 @@ void SvxMSDffManager::StoreShapeOrder(sal_uLong nId, SwFlyFrmFmt* pFly, short nHdFtSection) const { - sal_uInt16 nShpCnt = pShapeOrders->Count(); + sal_uInt16 nShpCnt = pShapeOrders->size(); for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++) { - SvxMSDffShapeOrder& rOrder - = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum )); + SvxMSDffShapeOrder& rOrder = *(*pShapeOrders)[ nShapeNum ]; if( rOrder.nShapeId == nId ) { @@ -5681,11 +5680,10 @@ void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject, SwFlyFrmFmt* pFly, SdrObject* pObject) const { - sal_uInt16 nShpCnt = pShapeOrders->Count(); + sal_uInt16 nShpCnt = pShapeOrders->size(); for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++) { - SvxMSDffShapeOrder& rOrder - = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum )); + SvxMSDffShapeOrder& rOrder = *(*pShapeOrders)[ nShapeNum ]; if( rOrder.pObj == pOldObject ) { @@ -5699,11 +5697,10 @@ void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject, void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const { - sal_uInt16 nShpCnt = pShapeOrders->Count(); + sal_uInt16 nShpCnt = pShapeOrders->size(); for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++) { - SvxMSDffShapeOrder& rOrder - = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum )); + SvxMSDffShapeOrder& rOrder = *(*pShapeOrders)[ nShapeNum ]; if( rOrder.pObj == pObject ) { @@ -5723,11 +5720,9 @@ void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const SV_IMPL_PTRARR( SvxMSDffBLIPInfos, SvxMSDffBLIPInfo_Ptr ); -SV_IMPL_PTRARR( SvxMSDffShapeOrders, SvxMSDffShapeOrder_Ptr ); - SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeInfos, SvxMSDffShapeInfo_Ptr ); -SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr ); +SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder* ); // Liste aller SvxMSDffImportRec fuer eine Gruppe @@ -6371,8 +6366,7 @@ sal_Bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, aInfo.bReplaceByFly = sal_True; } pShapeInfos->Insert( new SvxMSDffShapeInfo( aInfo ) ); - pShapeOrders->Insert( new SvxMSDffShapeOrder( aInfo.nShapeId ), - pShapeOrders->Count() ); + pShapeOrders->push_back( new SvxMSDffShapeOrder( aInfo.nShapeId ) ); } // und den Stream wieder korrekt positionieren @@ -7650,4 +7644,10 @@ SdrObject* SvxMSDffManager::getShapeForId( sal_Int32 nShapeId ) return aIter != maShapeIdContainer.end() ? (*aIter).second : 0; } +SvxMSDffShapeOrders::~SvxMSDffShapeOrders() +{ + for( const_iterator it = begin(); it != end(); ++it ) + delete *it; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |