summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-27 18:06:31 +0100
committerMichael Stahl <mstahl@redhat.com>2015-10-28 14:47:16 +0100
commit44d38a110b87afbba6f8221e226ce22a93a39127 (patch)
tree8867f2c854224fbc511f5cdbc21d939476848731 /sw
parent191ca975b7fd37d79d8b82fdf4ecb5f298625c22 (diff)
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I32edfa929aa81431a1e20180f3fd8a539ad43274
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx31
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx5
-rw-r--r--sw/source/filter/ww8/ww8par.hxx1
3 files changed, 21 insertions, 16 deletions
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<WW8_WrFkp>(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<sal_uInt8*>(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<WW8_WrFkp>(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 <vcl/graph.hxx>
#include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <map>
@@ -1253,13 +1252,13 @@ public:
};
// Plc for Chpx and Papx ( incl PN-Plc )
-typedef boost::ptr_vector<WW8_WrFkp> WW8_WrFkpPtrs;
+typedef std::vector<std::unique_ptr<WW8_WrFkp>> 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 <oox/ole/olehelper.hxx>
#include <boost/noncopyable.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
class SwDoc;
class SwPaM;