diff options
author | Eike Rathke <erack@redhat.com> | 2016-10-07 19:28:18 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-10-07 19:49:25 +0200 |
commit | 180fe3e991432a5ab1ef573686ff9b35c732756b (patch) | |
tree | 297f0035bddb63cdc887aeea91ff6f2cfc39ab2b /sc | |
parent | 1b786fb2db9b555fd9882487f1f0375bd93f6e32 (diff) |
tdf#101562 inserting within an entire col/row reference needs to flag change
This is the insert part (e.g. Undo) of the bug scenario.
Change-Id: I87060bd9f0ad6d58a11308e58e7ce56875327c52
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/token.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 156b099f4500..407a1006d5d9 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -3019,10 +3019,23 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon if (rCxt.maRange.In(aAbs)) { - ScRange aErrorRange( ScAddress::UNINITIALIZED ); - if (!aAbs.MoveSticky(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, aErrorRange)) - aAbs = aErrorRange; - aRes.mbReferenceModified = true; + // We shift either by column or by row, not both, + // so moving the reference has only to be done in + // the non-sticky case. + if ((rCxt.mnRowDelta && rRef.IsEntireCol()) || (rCxt.mnColDelta && rRef.IsEntireRow())) + { + // In entire col/row, values are shifted within + // the reference, which affects all positional + // results like in MATCH or matrix positions. + aRes.mbValueChanged = true; + } + else + { + ScRange aErrorRange( ScAddress::UNINITIALIZED ); + if (!aAbs.MoveSticky(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, aErrorRange)) + aAbs = aErrorRange; + aRes.mbReferenceModified = true; + } } else if (rCxt.maRange.Intersects(aAbs)) { |