From 44d38a110b87afbba6f8221e226ce22a93a39127 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 27 Oct 2015 18:06:31 +0100 Subject: sw: replace boost::ptr_vector with std::vector Change-Id: I32edfa929aa81431a1e20180f3fd8a539ad43274 --- sw/source/filter/ww8/wrtww8.cxx | 31 ++++++++++++++++++------------- sw/source/filter/ww8/wrtww8.hxx | 5 ++--- sw/source/filter/ww8/ww8par.hxx | 1 + 3 files changed, 21 insertions(+), 16 deletions(-) (limited to 'sw') diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index cebe0710b607..3ddf5945e826 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -860,8 +860,7 @@ WW8_WrPlcPn::WW8_WrPlcPn(WW8Export& rWr, ePLCFT ePl, WW8_FC nStartFc) , nFkpStartPage(0) , ePlc(ePl) { - WW8_WrFkp* pF = new WW8_WrFkp(ePlc, nStartFc); - aFkps.push_back( pF ); + m_Fkps.push_back(o3tl::make_unique(ePlc, nStartFc)); } WW8_WrPlcPn::~WW8_WrPlcPn() @@ -870,13 +869,13 @@ WW8_WrPlcPn::~WW8_WrPlcPn() sal_uInt8 *WW8_WrPlcPn::CopyLastSprms(sal_uInt8 &rLen) { - WW8_WrFkp& rF = aFkps.back(); + WW8_WrFkp& rF = *m_Fkps.back(); return rF.CopyLastSprms(rLen); } void WW8_WrPlcPn::AppendFkpEntry(WW8_FC nEndFc,short nVarLen,const sal_uInt8* pSprms) { - WW8_WrFkp* pF = &aFkps.back(); + WW8_WrFkp* pF = m_Fkps.back().get(); // big sprm? build the sprmPHugePapx sal_uInt8* pNewSprms = const_cast(pSprms); @@ -915,7 +914,7 @@ void WW8_WrPlcPn::AppendFkpEntry(WW8_FC nEndFc,short nVarLen,const sal_uInt8* pS pF->Combine(); pF = new WW8_WrFkp(ePlc, pF->GetEndFc()); // Start new Fkp == end of old Fkp - aFkps.push_back( pF ); + m_Fkps.push_back(std::unique_ptr(pF)); if( !pF->Append( nEndFc, nVarLen, pNewSprms ) ) { OSL_ENSURE( false, "Sprm liess sich nicht einfuegen" ); @@ -929,18 +928,20 @@ void WW8_WrPlcPn::WriteFkps() { nFkpStartPage = (sal_uInt16) ( SwWW8Writer::FillUntil( rWrt.Strm() ) >> 9 ); - for( size_t i = 0; i < aFkps.size(); i++ ) - aFkps[ i ].Write( rWrt.Strm(), *rWrt.m_pGrf ); + for( size_t i = 0; i < m_Fkps.size(); i++ ) + { + m_Fkps[ i ]->Write( rWrt.Strm(), *rWrt.m_pGrf ); + } if( CHP == ePlc ) { rWrt.pFib->pnChpFirst = nFkpStartPage; - rWrt.pFib->cpnBteChp = aFkps.size(); + rWrt.pFib->cpnBteChp = m_Fkps.size(); } else { rWrt.pFib->pnPapFirst = nFkpStartPage; - rWrt.pFib->cpnBtePap = aFkps.size(); + rWrt.pFib->cpnBtePap = m_Fkps.size(); } } @@ -949,16 +950,20 @@ void WW8_WrPlcPn::WritePlc() sal_uLong nFcStart = rWrt.pTableStrm->Tell(); sal_uInt16 i; - for( i = 0; i < aFkps.size(); i++ ) + for (i = 0; i < m_Fkps.size(); ++i) + { SwWW8Writer::WriteLong( *rWrt.pTableStrm, - aFkps[ i ].GetStartFc() ); + m_Fkps[ i ]->GetStartFc() ); + } SwWW8Writer::WriteLong( *rWrt.pTableStrm, - aFkps[ i - 1 ].GetEndFc() ); + m_Fkps[ i - 1 ]->GetEndFc() ); // fuer jedes FKP die Page ausgeben - for ( i = 0; i < aFkps.size(); i++) + for (i = 0; i < m_Fkps.size(); ++i) + { SwWW8Writer::WriteLong( *rWrt.pTableStrm, i + nFkpStartPage ); + } if( CHP == ePlc ) { diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 7bb353b40ce6..e05c50e9b676 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -39,7 +39,6 @@ #include #include -#include #include #include @@ -1253,13 +1252,13 @@ public: }; // Plc for Chpx and Papx ( incl PN-Plc ) -typedef boost::ptr_vector WW8_WrFkpPtrs; +typedef std::vector> WW8_WrFkpPtrs; class WW8_WrPlcPn // Plc for Page Numbers { private: WW8Export& rWrt; - WW8_WrFkpPtrs aFkps; // PTRARR + WW8_WrFkpPtrs m_Fkps; sal_uInt16 nFkpStartPage; ePLCFT ePlc; diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 3e855b96a394..1db7c2587fb7 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -55,6 +55,7 @@ #include #include +#include class SwDoc; class SwPaM; -- cgit