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

Eike Rathke erack at redhat.com
Fri Jul 15 23:52:22 UTC 2016


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

New commits:
commit ab1b351840160655a9f0caedbb35e9fdf203c5a0
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

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f81a34b..2d7b016 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -4414,7 +4414,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())
@@ -4436,7 +4439,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