diff options
author | Eike Rathke <erack@redhat.com> | 2016-04-01 13:16:41 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-04-01 13:24:41 +0200 |
commit | 8dc3b88b567d5fc4a75453654da860c47ae16403 (patch) | |
tree | 243a96387d5c53768c7d7e626c8afd591ef3c56a | |
parent | 88e5fa24eab7b89e946a340e9cf75951cbbffd79 (diff) |
copy used names to other doc, not only referencing sheet; tdf#56518
Change-Id: I434663a2ffe9b0565cabcf210c643ec57c7ba07b
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index ac877f8e7803..725ad88e6618 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -453,7 +453,7 @@ MightReferenceSheet mightRangeNameReferenceSheet( ScRangeData* pData, SCTAB nRef */ bool findRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes, const FormulaToken* pToken, const ScDocument* pDoc, SCTAB nGlobalRefTab, SCTAB nLocalRefTab, - SCTAB nOldTokenTab, SCTAB nOldTokenTabReplacement, int nRecursion) + SCTAB nOldTokenTab, SCTAB nOldTokenTabReplacement, bool bSameDoc, int nRecursion) { const sal_uInt16 nTokenIndex = pToken->GetIndex(); SCTAB nTokenTab = pToken->GetSheet(); @@ -489,7 +489,7 @@ bool findRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes, const Form if (!pCode) return false; - bool bRef = false; + bool bRef = !bSameDoc; // include every name used when copying to other doc if (nRecursion < 126) // whatever.. 42*3 { for (const FormulaToken* p = pCode->First(); p; p = pCode->Next()) @@ -497,7 +497,7 @@ bool findRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes, const Form if (p->GetOpCode() == ocName) { bRef |= findRangeNamesReferencingSheet( rIndexes, p, pDoc, nGlobalRefTab, nLocalRefTab, - nOldTokenTab, nOldTokenTabReplacement, nRecursion+1); + nOldTokenTab, nOldTokenTabReplacement, bSameDoc, nRecursion+1); } } } @@ -712,7 +712,7 @@ void adjustRangeName(formula::FormulaToken* pToken, ScDocument& rNewDoc, const S const SCTAB nOldTokenTabReplacement = nOldTab; sc::UpdatedRangeNames aReferencingNames; findRangeNamesReferencingSheet( aReferencingNames, pToken, pOldDoc, - nGlobalRefTab, nLocalRefTab, nOldTokenTab, nOldTokenTabReplacement, 0); + nGlobalRefTab, nLocalRefTab, nOldTokenTab, nOldTokenTabReplacement, bSameDoc, 0); if (bEarlyBailOut && aReferencingNames.isEmpty(-1) && aReferencingNames.isEmpty(nOldTokenTabReplacement)) return; |