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
This commit is contained in:
Kohei Yoshida
2014-10-12 10:18:09 -04:00
parent bf8876bb7e
commit 0b29a16d1d
2 changed files with 7 additions and 1 deletions

View File

@@ -2044,6 +2044,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);

View File

@@ -2788,7 +2788,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 bNewListening = false;
bool bInDeleteUndo = false;