diff options
-rw-r--r-- | sc/source/core/tool/sharedformula.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx index 43b98725da68..62e031cca01c 100644 --- a/sc/source/core/tool/sharedformula.cxx +++ b/sc/source/core/tool/sharedformula.cxx @@ -119,11 +119,13 @@ void SharedFormulaUtil::splitFormulaCellGroups(CellStoreType& rCells, std::vecto for (++it; it != itEnd; ++it) { nRow = *it; - aPos = rCells.position(aPos.first, nRow); - if (aPos.first == rCells.end()) - return; - - splitFormulaCellGroup(aPos, nullptr); + if (ValidRow(nRow)) + { + aPos = rCells.position(aPos.first, nRow); + if (aPos.first == rCells.end()) + return; + splitFormulaCellGroup(aPos, nullptr); + } } } |