Kaydet (Commit) d7315b52 authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Andras Timar

adjustSingleRefInName() handle relative column and row independently

The absolute part needs to be adjusted when the referenced column or row
is moved, even if the other part is relative.

Change-Id: Ibd6c2f58b7e01ced4d2e521f29295c044d27924a
(cherry picked from commit f35673a8)
üst be0af7d6
...@@ -3227,18 +3227,12 @@ bool adjustSingleRefInName( ...@@ -3227,18 +3227,12 @@ bool adjustSingleRefInName(
return false; return false;
} }
if (rRef.IsColRel() || rRef.IsRowRel())
{
// Adjust references only when both column and row are absolute.
return false;
}
if (!rCxt.maRange.In(rRef.toAbs(rPos))) if (!rCxt.maRange.In(rRef.toAbs(rPos)))
return false; return false;
bool bChanged = false; bool bChanged = false;
if (rCxt.mnColDelta) if (rCxt.mnColDelta && !rRef.IsColRel())
{ {
// Adjust absolute column reference. // Adjust absolute column reference.
if (rCxt.maRange.aStart.Col() <= rRef.Col() && rRef.Col() <= rCxt.maRange.aEnd.Col()) if (rCxt.maRange.aStart.Col() <= rRef.Col() && rRef.Col() <= rCxt.maRange.aEnd.Col())
...@@ -3248,7 +3242,7 @@ bool adjustSingleRefInName( ...@@ -3248,7 +3242,7 @@ bool adjustSingleRefInName(
} }
} }
if (rCxt.mnRowDelta) if (rCxt.mnRowDelta && !rRef.IsRowRel())
{ {
// Adjust absolute row reference. // Adjust absolute row reference.
if (rCxt.maRange.aStart.Row() <= rRef.Row() && rRef.Row() <= rCxt.maRange.aEnd.Row()) if (rCxt.maRange.aStart.Row() <= rRef.Row() && rRef.Row() <= rCxt.maRange.aEnd.Row())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment