[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sc/source

Eike Rathke erack at redhat.com
Mon Jul 18 09:59:57 UTC 2016


 sc/source/core/tool/token.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit d1fe0d67111cfca14eae447a6c35541292f20228
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Jul 16 01:43:11 2016 +0200

    Resolves: tdf#100764 check row when determining bounds for deleted range
    
    Regression introduced with a2e591e26549294cdb07eb685d4069343404d898 for tdf#86502
    
    Change-Id: I493c458faedccfd6e2ddf849073a52661ef2e4d0
    (cherry picked from commit ab1b351840160655a9f0caedbb35e9fdf203c5a0)
    Reviewed-on: https://gerrit.libreoffice.org/27245
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index e20104b..f1ba088 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -4397,7 +4397,10 @@ void checkBounds(
     if (pDeletedRange && aAbs.aStart.Row() <= pDeletedRange->aStart.Row())
     {
         SCROW nOffset = pDeletedRange->aStart.Row() - aAbs.aStart.Row();
-        rBounds.push_back(rPos.Row()+nOffset);
+        SCROW nRow = rPos.Row() + nOffset;
+        // Unlike for rCheckRange, for pDeletedRange nRow can be anywhere>=0.
+        if (ValidRow(nRow))
+            rBounds.push_back(nRow);
     }
 
     if (aAbs.aEnd.Row() >= rCheckRange.aEnd.Row())
@@ -4419,7 +4422,10 @@ void checkBounds(
     if (pDeletedRange && aAbs.aEnd.Row() >= pDeletedRange->aEnd.Row())
     {
         SCROW nOffset = pDeletedRange->aEnd.Row() + 1 - aAbs.aStart.Row();
-        rBounds.push_back(rPos.Row()+nOffset);
+        SCROW nRow = rPos.Row() + nOffset;
+        // Unlike for rCheckRange, for pDeletedRange nRow can be ~anywhere.
+        if (ValidRow(nRow))
+            rBounds.push_back(nRow);
     }
 }
 


More information about the Libreoffice-commits mailing list