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 | |
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')
-rw-r--r-- | filter/inc/filter/msfilter/msdffimp.hxx | 10 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 28 |
2 files changed, 20 insertions, 18 deletions
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx index db15f86c8517..f5371d788388 100644 --- a/filter/inc/filter/msfilter/msdffimp.hxx +++ b/filter/inc/filter/msfilter/msdffimp.hxx @@ -181,8 +181,6 @@ typedef SvxMSDffBLIPInfo* SvxMSDffBLIPInfo_Ptr; typedef SvxMSDffShapeInfo* SvxMSDffShapeInfo_Ptr; -typedef SvxMSDffShapeOrder* SvxMSDffShapeOrder_Ptr; - typedef ::std::map< sal_Int32, SdrObject* > SvxMSDffShapeIdContainer; #define SVEXT_PERSIST_STREAM "\002OlePres000" @@ -190,12 +188,16 @@ typedef ::std::map< sal_Int32, SdrObject* > SvxMSDffShapeIdContainer; // nach der Reihenfolge des Auftretens sortiert werden: SV_DECL_PTRARR_DEL(SvxMSDffBLIPInfos, SvxMSDffBLIPInfo_Ptr, 16) -SV_DECL_PTRARR_DEL(SvxMSDffShapeOrders, SvxMSDffShapeOrder_Ptr, 16) +class SvxMSDffShapeOrders : public std::vector<SvxMSDffShapeOrder*> +{ +public: + ~SvxMSDffShapeOrders(); +}; // explizit sortiert werden: SV_DECL_PTRARR_SORT_DEL_VISIBILITY(SvxMSDffShapeInfos, SvxMSDffShapeInfo_Ptr, 16, MSFILTER_DLLPUBLIC) -SV_DECL_PTRARR_SORT_VISIBILITY(SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr, 16, MSFILTER_DLLPUBLIC) +SV_DECL_PTRARR_SORT_VISIBILITY(SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder*, 16, MSFILTER_DLLPUBLIC) #define SVXMSDFF_SETTINGS_CROP_BITMAPS 1 #define SVXMSDFF_SETTINGS_IMPORT_PPT 2 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: */ |