Kaydet (Commit) 369ee0b1 authored tarafından Eike Rathke's avatar Eike Rathke

introduce ScTokenArray::AdjustReferenceOnCopy(), tdf#92468

Change-Id: I0a7ac0d9d10e96223cd5f095a771aa6f9d271417
üst ad3d2b6c
...@@ -216,6 +216,12 @@ public: ...@@ -216,6 +216,12 @@ public:
*/ */
void AdjustReferenceOnMovedOriginIfOtherSheet( const ScAddress& rOldPos, const ScAddress& rNewPos ); void AdjustReferenceOnMovedOriginIfOtherSheet( const ScAddress& rOldPos, const ScAddress& rNewPos );
/**
* Adjust internal range references on base position change to justify /
* put in order the relative references.
*/
void AdjustReferenceOnCopy( const ScAddress& rNewPos );
/** /**
* Clear sheet deleted flag from internal reference tokens if the sheet * Clear sheet deleted flag from internal reference tokens if the sheet
* index falls within specified range. Note that when a reference is on a * index falls within specified range. Note that when a reference is on a
......
...@@ -3951,6 +3951,34 @@ void ScTokenArray::AdjustReferenceOnMovedOriginIfOtherSheet( const ScAddress& rO ...@@ -3951,6 +3951,34 @@ void ScTokenArray::AdjustReferenceOnMovedOriginIfOtherSheet( const ScAddress& rO
} }
} }
void ScTokenArray::AdjustReferenceOnCopy( const ScAddress& rNewPos )
{
TokenPointers aPtrs( pCode, nLen, pRPN, nRPN, false);
for (size_t j=0; j<2; ++j)
{
FormulaToken** pp = aPtrs.maPointerRange[j].mpStart;
FormulaToken** pEnd = aPtrs.maPointerRange[j].mpStop;
for (; pp != pEnd; ++pp)
{
FormulaToken* p = aPtrs.getHandledToken(j,pp);
if (!p)
continue;
switch (p->GetType())
{
case svDoubleRef:
{
ScComplexRefData& rRef = *p->GetDoubleRef();
rRef.PutInOrder( rNewPos);
}
break;
default:
;
}
}
}
}
namespace { namespace {
void clearTabDeletedFlag( ScSingleRefData& rRef, const ScAddress& rPos, SCTAB nStartTab, SCTAB nEndTab ) void clearTabDeletedFlag( ScSingleRefData& rRef, const ScAddress& rPos, SCTAB nStartTab, SCTAB nEndTab )
......
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