diff options
author | Eike Rathke <erack@redhat.com> | 2016-07-16 01:43:11 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2016-07-21 01:21:03 +0000 |
commit | 10b1fb083b3f66fb4099f84e94a1b4cd52ed1b06 (patch) | |
tree | 0ee9f998a7d9a4f3568a01c0736dab6206867001 | |
parent | f80bcfb2907bb4c2999280c8d1be060292122659 (diff) |
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/27248
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | sc/source/core/tool/token.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 76018e4f5136..fd390a47d6e6 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); } } |