diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-23 23:36:28 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-24 10:58:56 +0200 |
commit | b772f022192d2150aa6b33b1ce086c4645277023 (patch) | |
tree | 491da7a70f6b85caa2d3758a7145989cb6c0c0fd | |
parent | 355865211c50303095582f6e1dfbd5d209802b7b (diff) |
filter: convert boost::ptr_vector to std::vector
... and move it out of the header since it's only used in that class.
Change-Id: Icd5cc86428c97bdaaa07d56e17393846629721e5
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 24 | ||||
-rw-r--r-- | include/filter/msfilter/msdffimp.hxx | 16 |
2 files changed, 21 insertions, 19 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 1e62f40032dd..1a49e875efa1 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -149,6 +149,18 @@ using namespace container ; static sal_uInt32 nMSOleObjCntr = 0; #define MSO_OLE_Obj "MSO_OLE_Obj" +struct SvxMSDffBLIPInfo +{ + sal_uInt16 nBLIPType; ///< type of BLIP: e.g. 6 for PNG + sal_uLong nFilePos; ///< offset of the BLIP in data strem + sal_uLong nBLIPSize; ///< number of bytes that the BLIP needs in stream + SvxMSDffBLIPInfo(sal_uInt16 nBType, sal_uLong nFPos, sal_uLong nBSize): + nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){} +}; + +/// the following will be sorted by the order of their appearance: +struct SvxMSDffBLIPInfos : public std::vector<SvxMSDffBLIPInfo> {}; + /************************************************************************/ void Impl_OlePres::Write( SvStream & rStm ) { @@ -5528,7 +5540,7 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, bool bSkipImages ) :DffPropertyReader( *this ), pFormModel( NULL ), - pBLIPInfos( new SvxMSDffBLIPInfos ), + m_pBLIPInfos( new SvxMSDffBLIPInfos ), m_xShapeInfosByTxBxComp( new SvxMSDffShapeInfos_ByTxBxComp ), pShapeOrders( new SvxMSDffShapeOrders ), nOffsDgg( nOffsDgg_ ), @@ -5577,7 +5589,7 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const OUString& rBaseURL ) :DffPropertyReader( *this ), pFormModel( NULL ), - pBLIPInfos( new SvxMSDffBLIPInfos ), + m_pBLIPInfos( new SvxMSDffBLIPInfos ), m_xShapeInfosByTxBxComp( new SvxMSDffShapeInfos_ByTxBxComp ), pShapeOrders( new SvxMSDffShapeOrders ), nOffsDgg( 0 ), @@ -5603,7 +5615,7 @@ SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const OUString& rBaseURL ) SvxMSDffManager::~SvxMSDffManager() { delete pSecPropSet; - delete pBLIPInfos; + delete m_pBLIPInfos; delete pShapeOrders; delete pFormModel; } @@ -5879,7 +5891,7 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe nBLIPCount++; // now save the info for later access - pBLIPInfos->push_back( new SvxMSDffBLIPInfo( nInst, nBLIPPos, nBLIPLen ) ); + m_pBLIPInfos->push_back(SvxMSDffBLIPInfo(nInst, nBLIPPos, nBLIPLen)); } rSt.SeekRel( nLength ); } @@ -6217,7 +6229,7 @@ bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* pVisA if ( !bOk ) { sal_uInt16 nIdx = sal_uInt16( nIdx_ ); - if( !nIdx || (pBLIPInfos->size() < nIdx) ) + if (!nIdx || (m_pBLIPInfos->size() < nIdx)) return false; // possibly delete old error flag(s) @@ -6232,7 +6244,7 @@ bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* pVisA sal_uLong nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl; // fetch matching info struct out of the pointer array - SvxMSDffBLIPInfo& rInfo = (*pBLIPInfos)[ nIdx-1 ]; + SvxMSDffBLIPInfo& rInfo = (*m_pBLIPInfos)[ nIdx-1 ]; // jump to the BLIP atom in the data stream pStData->Seek( rInfo.nFilePos ); // possibly reset error status diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx index 5ef4b5c9b6f8..14fa1e5e2a24 100644 --- a/include/filter/msfilter/msdffimp.hxx +++ b/include/filter/msfilter/msdffimp.hxx @@ -56,7 +56,7 @@ class FmFormModel; class SdrModel; class SwFlyFrameFormat; -struct SvxMSDffBLIPInfo; +struct SvxMSDffBLIPInfos; struct SvxMSDffShapeInfo; struct SvxMSDffShapeOrder; @@ -109,8 +109,7 @@ typedef ::std::map< sal_Int32, SdrObject* > SvxMSDffShapeIdContainer; #define SVEXT_PERSIST_STREAM "\002OlePres000" -// the following two will be sorted by the order of their appearance: -typedef boost::ptr_vector<SvxMSDffBLIPInfo> SvxMSDffBLIPInfos; +/// the following will be sorted by the order of their appearance: typedef boost::ptr_vector<SvxMSDffShapeOrder> SvxMSDffShapeOrders; struct MSFILTER_DLLPUBLIC CompareSvxMSDffShapeInfoById @@ -400,7 +399,7 @@ public: class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader { FmFormModel* pFormModel; - SvxMSDffBLIPInfos* pBLIPInfos; + SvxMSDffBLIPInfos* m_pBLIPInfos; std::unique_ptr<SvxMSDffShapeInfos_ByTxBxComp> m_xShapeInfosByTxBxComp; std::unique_ptr<SvxMSDffShapeInfos_ById> m_xShapeInfosById; SvxMSDffShapeOrders* pShapeOrders; @@ -722,15 +721,6 @@ public: SdrObject* getShapeForId( sal_Int32 nShapeId ); }; -struct SvxMSDffBLIPInfo -{ - sal_uInt16 nBLIPType; ///< type of BLIP: e.g. 6 for PNG - sal_uLong nFilePos; ///< offset of the BLIP in data strem - sal_uLong nBLIPSize; ///< number of bytes that the BLIP needs in stream - SvxMSDffBLIPInfo(sal_uInt16 nBType, sal_uLong nFPos, sal_uLong nBSize): - nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){} -}; - struct SvxMSDffShapeInfo { sal_uInt32 nShapeId; ///< shape id, used in PLCF SPA and in mso_fbtSp (FSP) |