summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-27 22:00:33 +0100
committerMichael Stahl <mstahl@redhat.com>2015-10-28 14:47:17 +0100
commit3e2a6738969cea8ed2eb0e6c25fa2673ca756e63 (patch)
treefa876a51980cb6336041e8451f33ff272c31f15d
parent44d38a110b87afbba6f8221e226ce22a93a39127 (diff)
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I2bb543ce1678140e8a6e086171a8f6b4529771d3
-rw-r--r--sw/source/filter/ww8/ww8par.hxx3
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx1
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx29
3 files changed, 15 insertions, 18 deletions
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 1db7c2587fb7..6c6b3613368e 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -55,7 +55,6 @@
#include <oox/ole/olehelper.hxx>
#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
class SwDoc;
class SwPaM;
@@ -165,7 +164,7 @@ private:
const WW8Fib& rFib;
SvStream& rSt;
std::vector<WW8LSTInfo* > maLSTInfos;
- boost::ptr_vector<WW8LFOInfo > pLFOInfos;// D. from PLF LFO, sorted exactly like in the WW8 Stream
+ std::vector<std::unique_ptr<WW8LFOInfo>> m_LFOInfos;// D. from PLF LFO, sorted exactly like in the WW8 Stream
sal_uInt16 nUniqueList; // current number for creating unique list names
sal_uInt8* GrpprlHasSprm(sal_uInt16 nId, sal_uInt8& rSprms, sal_uInt8 nLen);
WW8LSTInfo* GetLSTByListId( sal_uInt32 nIdLst ) const;
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 35ce8629211a..c642c5c49f78 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <boost/noncopyable.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
#include <comphelper/string.hxx>
#include <tools/solar.h>
#include <vcl/vclenum.hxx>
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 4ddc3119497d..8ea78753242e 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -429,7 +429,7 @@ struct WW8LFOInfo // unsortiert, d.h. Reihenfolge genau wie im WW8 Stream
// an dem Tag, wo MS ihr Listenformat auf mehr als 15 Level aufbohren.
bool bOverride :1;// Flag, ob die NumRule nicht in maLSTInfos steht,
- // sondern fuer pLFOInfos NEU angelegt wurde
+ // sondern fuer m_LFOInfos NEU angelegt wurde
bool bSimpleList:1;// Flag, ob diese NumRule nur einen Level verwendet
bool bUsedInDoc :1;// Flag, ob diese NumRule im Doc verwendet wird,
// oder beim Reader-Ende geloescht werden sollte
@@ -1321,7 +1321,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
aLFO.bSimpleList = pParentListInfo->bSimpleList;
}
// und rein ins Merk-Array mit dem Teil
- WW8LFOInfo* pLFOInfo = new WW8LFOInfo(aLFO);
+ std::unique_ptr<WW8LFOInfo> pLFOInfo(new WW8LFOInfo(aLFO));
if (pParentListInfo)
{
//Copy the basic paragraph properties for each level from the
@@ -1331,7 +1331,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
for (int i = 0; i < nMaxSize; ++i)
pLFOInfo->maParaSprms[i] = pParentListInfo->maParaSprms[i];
}
- pLFOInfos.push_back(pLFOInfo);
+ m_LFOInfos.push_back(std::move(pLFOInfo));
bOk = true;
}
@@ -1340,10 +1340,10 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
// 2.2 fuer alle LFO die zugehoerigen LFOLVL einlesen
- size_t nLFOInfos = pLFOInfos.size();
+ size_t nLFOInfos = m_LFOInfos.size();
for (size_t nLfo = 0; nLfo < nLFOInfos; ++nLfo)
{
- WW8LFOInfo& rLFOInfo = pLFOInfos[nLfo];
+ WW8LFOInfo& rLFOInfo = *m_LFOInfos[nLfo];
// stehen hierfuer ueberhaupt LFOLVL an ?
if( rLFOInfo.bOverride )
{
@@ -1510,17 +1510,14 @@ WW8ListManager::~WW8ListManager()
}
delete *aIter;
}
- boost::ptr_vector<WW8LFOInfo >::reverse_iterator aIter;
- for (aIter = pLFOInfos.rbegin() ;
- aIter < pLFOInfos.rend();
- ++aIter )
+ for (auto aIter = m_LFOInfos.rbegin(); aIter < m_LFOInfos.rend(); ++aIter)
{
- if (aIter->bOverride
- && aIter->pNumRule
- && !aIter->bUsedInDoc
- && aIter->pNumRule->IsAutoRule())
+ if ((*aIter)->bOverride
+ && (*aIter)->pNumRule
+ && !(*aIter)->bUsedInDoc
+ && (*aIter)->pNumRule->IsAutoRule())
{
- rDoc.DelNumRule( aIter->pNumRule->GetName() );
+ rDoc.DelNumRule( (*aIter)->pNumRule->GetName() );
}
}
}
@@ -1557,10 +1554,10 @@ bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo)
SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition,
const sal_uInt8 nLevel, std::vector<sal_uInt8> &rParaSprms, SwTextNode *pNode)
{
- if (pLFOInfos.size() <= nLFOPosition)
+ if (m_LFOInfos.size() <= nLFOPosition)
return 0;
- WW8LFOInfo& rLFOInfo = pLFOInfos[nLFOPosition];
+ WW8LFOInfo& rLFOInfo = *m_LFOInfos[nLFOPosition];
bool bFirstUse = !rLFOInfo.bUsedInDoc;
rLFOInfo.bUsedInDoc = true;