diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-10-27 22:09:45 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-10-28 14:47:17 +0100 |
commit | ade0e181ac5c58186a71969fc5e81ad570d33fb3 (patch) | |
tree | 0b859be3cfd174f22b6bb93173b134e6993c3c64 | |
parent | 3e2a6738969cea8ed2eb0e6c25fa2673ca756e63 (diff) |
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I85409838a5c44f8e76c60ff88e41c01d2bb71987
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index c642c5c49f78..c4e1abfab91b 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -20,7 +20,6 @@ #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> @@ -89,7 +88,7 @@ public: {} }; -typedef boost::ptr_vector<WW8SelBoxInfo> WW8MergeGroups; +typedef std::vector<std::unique_ptr<WW8SelBoxInfo>> WW8MergeGroups; WW8TabBandDesc::WW8TabBandDesc() { @@ -123,7 +122,7 @@ class WW8TabDesc: private boost::noncopyable SwTableBoxes* pTabBoxes; // boxes array in current row SwTableBox* pTabBox; // current cell - WW8MergeGroups aMergeGroups; // list of all cells to be merged + WW8MergeGroups m_MergeGroups; // list of all cells to be merged WW8_TCell* pAktWWCell; @@ -2617,7 +2616,7 @@ void WW8TabDesc::MergeCells() } // 3. push to group array - aMergeGroups.push_back(pActMGroup); + m_MergeGroups.push_back(std::unique_ptr<WW8SelBoxInfo>(pActMGroup)); } // if necessary add the current box to a merge group @@ -2697,13 +2696,10 @@ void WW8TabDesc::FinishSwTable() MergeCells(); // if needed group cells together that should be merged - if( !aMergeGroups.empty() ) + if (!m_MergeGroups.empty()) { // process all merge groups one by one - for ( - WW8MergeGroups::iterator groupIt = aMergeGroups.begin(); - groupIt != aMergeGroups.end(); - ++groupIt) + for (auto const& groupIt : m_MergeGroups) { sal_uInt16 nActBoxCount = groupIt->size(); @@ -2721,11 +2717,11 @@ void WW8TabDesc::FinishSwTable() } } pIo->m_pFormatOfJustInsertedApo = 0; - aMergeGroups.clear(); + m_MergeGroups.clear(); } } -// browse aMergeGroups, detect the index of the first fitting group or -1 otherwise +// browse m_MergeGroups, detect the index of the first fitting group or -1 otherwise // Parameter: nXcenter = center position of asking box // nWidth = width of asking box @@ -2734,7 +2730,7 @@ void WW8TabDesc::FinishSwTable() WW8SelBoxInfo* WW8TabDesc::FindMergeGroup(short nX1, short nWidth, bool bExact) { - if( !aMergeGroups.empty() ) + if (!m_MergeGroups.empty()) { // still valid area near the boundery const short nToleranz = 4; @@ -2745,10 +2741,10 @@ WW8SelBoxInfo* WW8TabDesc::FindMergeGroup(short nX1, short nWidth, bool bExact) short nGrX2; // improvement: search backwards - for ( short iGr = aMergeGroups.size() - 1; iGr >= 0; --iGr ) + for (short iGr = m_MergeGroups.size() - 1; iGr >= 0; --iGr) { // the currently inspected group - WW8SelBoxInfo& rActGroup = aMergeGroups[ iGr ]; + WW8SelBoxInfo& rActGroup = *m_MergeGroups[ iGr ]; if (!rActGroup.bGroupLocked) { // approximate group boundery with room (tolerance) to the *outside* |