summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/token.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-01 12:16:12 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-01 20:00:05 +0000
commita7699355d355a1817fc16b4832f96a3a9e17d5df (patch)
treeb6179243c0f6021bbb163a414a85d99f8cdeed11 /sc/source/core/tool/token.cxx
parent75a839188d1cac5f0ac602e59462b32879d2242a (diff)
fdo#77806: Use the common block position set for start and end listening.
Else an invalid iterator may result, which would eventually leads to a crash. Change-Id: Ie909de61244d661c72a3450cc69b29fbb218a248 (cherry picked from commit 7fbe0f56192f7e106c560646d37fbb93b69b0446) Reviewed-on: https://gerrit.libreoffice.org/9225 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/core/tool/token.cxx')
-rw-r--r--sc/source/core/tool/token.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 9089a62afd1b..65ed7ad1a828 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2799,13 +2799,17 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon
sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
const sc::RefUpdateContext& rCxt, const ScAddress& rOldPos, const ScAddress& rNewPos )
{
+ sc::RefUpdateResult aRes;
+
+ if (!rCxt.mnColDelta && !rCxt.mnRowDelta && !rCxt.mnTabDelta)
+ // The cell hasn't moved at all.
+ return aRes;
+
// When moving, the range is the destination range. We need to use the old
// range prior to the move for hit analysis.
ScRange aOldRange = rCxt.maRange;
aOldRange.Move(-rCxt.mnColDelta, -rCxt.mnRowDelta, -rCxt.mnTabDelta);
- sc::RefUpdateResult aRes;
-
FormulaToken** p = pCode;
FormulaToken** pEnd = p + static_cast<size_t>(nLen);
for (; p != pEnd; ++p)