diff options
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index c3db7a97121c..e234bf0b4ab4 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -728,7 +728,7 @@ void adjustRangeName(formula::FormulaToken* pToken, ScDocument& rNewDoc, const S pOldRangeData, rNewDoc, pOldDoc, rNewPos, rOldPos, bGlobalNamesToLocal, nTmpSheet, nNewSheet, bSameDoc); } - if (bGlobalNamesToLocal && !aReferencingNames.isEmpty(-1)) + if ((bGlobalNamesToLocal || !bSameDoc) && !aReferencingNames.isEmpty(-1)) { const SCTAB nTmpSheet = -1; ScRangeData* pTmpData = copyRangeNames( aSheetIndexMap, aRangeDataVec, aReferencingNames, -1, |