fdo#75815: Adjust external references here too.

Adjusting external references are much simpler than adjusting internal
ones since we don't need to worry about deleted references etc.

Change-Id: I82111e383e1fc6976ef08c1438c3dd916a249af6
This commit is contained in:
Kohei Yoshida
2014-03-10 20:39:01 -04:00
parent 149b580900
commit dd7787ed75

View File

@@ -2751,6 +2751,25 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon
rRef.SetRange(aAbs, aNewPos);
}
break;
case svExternalSingleRef:
{
// For external reference, just reset the reference with
// respect to the new cell position.
ScToken* pToken = static_cast<ScToken*>(*p);
ScSingleRefData& rRef = pToken->GetSingleRef();
ScAddress aAbs = rRef.toAbs(rOldPos);
rRef.SetAddress(aAbs, aNewPos);
}
break;
case svExternalDoubleRef:
{
// Same as above.
ScToken* pToken = static_cast<ScToken*>(*p);
ScComplexRefData& rRef = pToken->GetDoubleRef();
ScRange aAbs = rRef.toAbs(rOldPos);
rRef.SetRange(aAbs, aNewPos);
}
break;
case svIndex:
{
const formula::FormulaToken* pToken = *p;