[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Sun Oct 12 07:31:29 PDT 2014
sc/source/core/data/column.cxx | 6 ++++++
sc/source/core/data/formulacell.cxx | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit c74fbd22dd3decc37574da210157cea4e7a6b1a2
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Sun Oct 12 10:18:09 2014 -0400
fdo#83901: ROW() and COLUMN() to be properly recalculated on cell move.
For cases where ROW or COLUMN references another cell that has shifted.
Change-Id: Ic4bef8672dab811ceff6886d9af0388306a66485
(cherry picked from commit 0b29a16d1dcffd75e49bd7ad3da867b0d0ebfa38)
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 10da725..ec1224c 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2110,6 +2110,12 @@ class UpdateRefOnNonCopy : std::unary_function<sc::FormulaGroupEntry, void>
if (pCode->IsRecalcModeOnRefMove())
aRes.mbValueChanged = true;
}
+ else if (aRes.mbReferenceModified && pCode->IsRecalcModeOnRefMove())
+ {
+ // The cell itself hasn't shifted. But it may have ROW or COLUMN
+ // referencing another cell that has.
+ aRes.mbValueChanged = true;
+ }
if (aRes.mbNameModified)
recompileTokenArray(*pTop);
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index bbaff4f..3887caa 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2767,7 +2767,7 @@ bool ScFormulaCell::UpdateReferenceOnShift(
if (bOnRefMove)
// Cell may reference itself, e.g. ocColumn, ocRow without parameter
- bOnRefMove = (bValChanged || (aPos != aOldPos));
+ bOnRefMove = (bValChanged || (aPos != aOldPos) || bRefModified);
bool bHasRelName = false;
bool bNewListening = false;
More information about the Libreoffice-commits
mailing list