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

Eike Rathke erack at redhat.com
Mon Jul 18 10:05:16 UTC 2016


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

New commits:
commit 9bcc12e3b8f29067443b96cfc20cca5d183ed5cd
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/27246
    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 76018e4..fd390a4 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -4250,7 +4250,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())
@@ -4272,7 +4275,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