[Libreoffice-commits] core.git: sc/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Mar 19 13:51:24 UTC 2018


 sc/source/core/data/drwlayer.cxx |    6 +++---
 sc/source/ui/view/viewfun2.cxx   |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2ec02d7ea1337df3adabe9ac91d4f506e3372c80
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Mar 19 13:03:09 2018 +0200

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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)


More information about the Libreoffice-commits mailing list