summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2018-08-06 12:48:17 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-06 08:53:03 +0200
commit61a54ea68e63aee498a3dd938fbb7fe58416046f (patch)
treebd30793ba8408fc93322d524f6985bcf1d811c9b
parent8d9aea221f4233e861343b48dab5d5d629b2f4d6 (diff)
sw: Prefer std::vector for SwLineOffsetArray to std::list
as its instance adds an element only at the end, and no erase. Change-Id: I41dc7c4d0f7d070b7ce0cef2e36ee73c05f342ae Reviewed-on: https://gerrit.libreoffice.org/58635 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/table/swnewtable.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 4c78fa0d1ceb..33fb40cd0319 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -1201,7 +1201,7 @@ void SwTable::InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt
}
typedef std::pair< sal_uInt16, sal_uInt16 > SwLineOffset;
-typedef std::list< SwLineOffset > SwLineOffsetArray;
+typedef std::vector< SwLineOffset > SwLineOffsetArray;
/*
* When a couple of table boxes has to be split,
@@ -1260,8 +1260,7 @@ static void lcl_SophisticatedFillLineIndices( SwLineOffsetArray &rArr,
}
OSL_ENSURE( aLnOfs.second < nCnt, "Clean-up failed" );
aLnOfs.second = nCnt - aLnOfs.second; // the number of rows to insert
- rArr.insert( rArr.end(),
- SwLineOffset( aLnOfs.first - nSum, aLnOfs.second ) );
+ rArr.emplace_back( aLnOfs.first - nSum, aLnOfs.second );
// the correction has to be incremented because in the following
// loops the line ends were manipulated
nSum = nSum + aLnOfs.second;