summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-15 17:50:10 +0200
committerEike Rathke <erack@redhat.com>2015-06-15 17:52:17 +0200
commitd53ad9250d77f89a2a7d260a98090a8504c12108 (patch)
tree46e842ea633318f93ade9f37b5c98acf94958429 /sc
parent1d463600f4db2993838c7660da2cb87aa19218fd (diff)
use ReplaceToken() in ReadjustAbsolute3DReferences()
Actually the RPN token needs to be replaced as well if it was referenced. Change-Id: Ie548568dceadaf315ae5596c480916730bed2dca
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/token.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4479488eac64..71bc28c544a5 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2360,10 +2360,8 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
OUString aTabName;
sal_uInt16 nFileId;
GetExternalTableData(pOldDoc, pNewDoc, rRef1.Tab(), aTabName, nFileId);
- ScExternalDoubleRefToken* pToken = new ScExternalDoubleRefToken(nFileId, aTabName, rRef);
- pToken->IncRef();
- pCode[j]->DecRef(); // ATTENTION: rRef can't be used after this point
- pCode[j] = pToken;
+ ReplaceToken( j, new ScExternalDoubleRefToken(nFileId, aTabName, rRef), FORWARD_CODE_AND_RPN);
+ // ATTENTION: rRef can't be used after this point
}
}
break;
@@ -2379,11 +2377,8 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
OUString aTabName;
sal_uInt16 nFileId;
GetExternalTableData(pOldDoc, pNewDoc, rRef.Tab(), aTabName, nFileId);
- //replace with ScExternalSingleRefToken and adjust references
- ScExternalSingleRefToken* pToken = new ScExternalSingleRefToken(nFileId, aTabName, rRef);
- pToken->IncRef();
- pCode[j]->DecRef(); // ATTENTION: rRef can't be used after this point
- pCode[j] = pToken;
+ ReplaceToken( j, new ScExternalSingleRefToken(nFileId, aTabName, rRef), FORWARD_CODE_AND_RPN);
+ // ATTENTION: rRef can't be used after this point
}
}
break;