diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-11-06 23:22:57 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-11-07 07:01:58 +0100 |
commit | d0dd80c8afd83dcfe0788d1c428996a9d8a85fa0 (patch) | |
tree | 12647f821d0cfabaaa9d1fa185637a6cfb0dbc69 /sw | |
parent | 8c4b480e85bbafb7b914377a3e279f6982ff9044 (diff) |
Replace some lists by vectors (sw)
Change-Id: I9fef822040403fc61d00240c07b63e9394cf069f
Reviewed-on: https://gerrit.libreoffice.org/44379
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/table/swnewtable.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 3 |
2 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index 391e1b1081f3..9a2a7372ddd8 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -371,7 +371,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const long nMid = ( nMin + nMax ) / 2; SwBoxSelection* pRet = new SwBoxSelection(); - std::list< std::pair< SwTableBox*, long > > aNewWidthList; + std::vector< std::pair< SwTableBox*, long > > aNewWidthVector; size_t nCheckBottom = nBottom; long nLeftSpan = 0; long nRightSpan = 0; @@ -543,10 +543,10 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const std::pair< SwTableBox*, long > aTmp; aTmp.first = pInnerBox; aTmp.second = -nDiff; - aNewWidthList.push_back( aTmp ); + aNewWidthVector.push_back(aTmp); aTmp.first = pOuterBox; aTmp.second = nDiff; - aNewWidthList.push_back( aTmp ); + aNewWidthVector.push_back(aTmp); } pOuterBox = pOuterBox == pRightBox ? nullptr : pRightBox; if( nDiff2 ) @@ -565,14 +565,11 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const bOkay = false; if( bOkay ) { - std::list< std::pair< SwTableBox*, long > >::iterator - pCurr = aNewWidthList.begin(); - while( pCurr != aNewWidthList.end() ) + for (auto const& newWidth : aNewWidthVector) { - SwFrameFormat* pFormat = pCurr->first->ClaimFrameFormat(); - long nNewWidth = pFormat->GetFrameSize().GetWidth() + pCurr->second; + SwFrameFormat* pFormat = newWidth.first->ClaimFrameFormat(); + long nNewWidth = pFormat->GetFrameSize().GetWidth() + newWidth.second; pFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nNewWidth, 0 ) ); - ++pCurr; } } else diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index ce2d9a370ad3..1905492f50ef 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -18,7 +18,6 @@ */ #include <tuple> -#include <list> #include <array> #include <utility> #include <memory> @@ -1803,7 +1802,7 @@ bool SwTableProperties_Impl::GetProperty(sal_uInt16 nWhichId, sal_uInt16 nMember template<typename Tpoolitem> void SwTableProperties_Impl::AddItemToSet(SfxItemSet& rSet, std::function<Tpoolitem()> aItemFactory, sal_uInt16 nWhich, std::initializer_list<sal_uInt16> vMember, bool bAddTwips) { - std::list< std::pair<sal_uInt16, const uno::Any* > > vMemberAndAny; + std::vector< std::pair<sal_uInt16, const uno::Any* > > vMemberAndAny; for(sal_uInt16 nMember : vMember) { const uno::Any* pAny = nullptr; |