summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-19 13:03:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-19 14:51:01 +0100
commit2ec02d7ea1337df3adabe9ac91d4f506e3372c80 (patch)
treecb8eb35a01fcacd4f7b3019d6841ffadc45e58d3
parent5c1b5daa90615170f2131e081f9a2f1a4b9b7a85 (diff)
tdf#116421 autosum is not working
regression from commit 6529cd54c29c5800340530a1b8182c341fbeeafb don't use heap for elements in ScRangeList The change in lcl_MoveRanges is not part of the fix, just something else I noticed when reviewing the problematic commit Change-Id: I958937f92a84f6e8e7bec607705c3a958d70ad3c Reviewed-on: https://gerrit.libreoffice.org/51547 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/core/data/drwlayer.cxx6
-rw-r--r--sc/source/ui/view/viewfun2.cxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index a23b721b4b6b..a239079e28b0 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1510,13 +1510,13 @@ static bool lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const S
ScRangeList& rRanges = *aIt;
for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
{
- ScRange aRange = rRanges[ i ];
- if ( rSourceRange.In( aRange ) )
+ ScRange & rRange = rRanges[ i ];
+ if ( rSourceRange.In( rRange ) )
{
SCCOL nDiffX = rDestPos.Col() - rSourceRange.aStart.Col();
SCROW nDiffY = rDestPos.Row() - rSourceRange.aStart.Row();
SCTAB nDiffZ = rDestPos.Tab() - rSourceRange.aStart.Tab();
- if (!aRange.Move( nDiffX, nDiffY, nDiffZ, aErrorRange))
+ if (!rRange.Move( nDiffX, nDiffY, nDiffZ, aErrorRange))
{
assert(!"can't move range");
}
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index e572964ec1b8..e176bbffb54c 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -750,7 +750,7 @@ OUString ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSub
{
ScRangeList aRangeList = rRangeList;
size_t ListSize = aRangeList.size();
- for ( size_t i = 1; i < ListSize; ++i )
+ for ( size_t i = 0; i < ListSize; ++i )
{
const ScRange & r = aRangeList[i];
if (i != 0)