summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 10:51:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 14:37:58 +0100
commite54f4cc24d29fe133a5eaae90515f74c64644159 (patch)
tree2aa38c389bd37a2ff1bfba260d69d53865ca2622 /sc
parent1970a686273c5d4fc1eeb4430283e37085d9f647 (diff)
tdf#113530 LibreOffice hangs when pasting a few columns
regression from commit d6fb5ca5661195520ca7a7ca2d0145a1e11be099 dyncolcontainer: use ScCompressedArray for pColWidth Change-Id: I3d8b71e7df581346d4a52204cb1230fb80c6e8bb Reviewed-on: https://gerrit.libreoffice.org/44099 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/compressedarray.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index 28c06d9d87e4..6e8ca59bf5ac 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -215,6 +215,7 @@ template< typename A, typename D >
void ScCompressedArray<A,D>::CopyFrom( const ScCompressedArray<A,D>& rArray, A nDestStart,
A nDestEnd, A nSrcStart )
{
+ assert( this != &rArray && "cannot copy self->self" );
size_t nIndex = 0;
A nRegionEnd;
for (A j=nDestStart; j<=nDestEnd; ++j)
@@ -222,6 +223,7 @@ void ScCompressedArray<A,D>::CopyFrom( const ScCompressedArray<A,D>& rArray, A n
const D& rValue = (j==nDestStart ?
rArray.GetValue( j - nDestStart + nSrcStart, nIndex, nRegionEnd) :
rArray.GetNextValue( nIndex, nRegionEnd));
+ nRegionEnd = nRegionEnd - nSrcStart + nDestStart;
if (nRegionEnd > nDestEnd)
nRegionEnd = nDestEnd;
this->SetValue( j, nRegionEnd, rValue);