diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/formulabuffer.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index 065107185182..21e383fe97b7 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -166,7 +166,7 @@ void FormulaBuffer::applySharedFormulas( sal_Int32 nTab ) // shared formulas across multiple columns. ScFormulaCellGroupRef xNewGroup(new ScFormulaCellGroup); xNewGroup->mnStart = rRange.StartRow; - xNewGroup->mnLength = rRange.EndRow - rRange.StartRow + 1; + xNewGroup->mnLength = 1; // Length gets updated as we go. xNewGroup->setCode(*pArray); aGroups.set(nId, nCol, xNewGroup); } @@ -200,6 +200,9 @@ void FormulaBuffer::applySharedFormulas( sal_Int32 nTab ) continue; } + // Update the length of shared formula span as we go. The length + // that Excel gives is not always correct. + xGroup->mnLength = aPos.Row() - xGroup->mnStart + 1; pCell->StartListeningTo(&rDoc); if (it->maCellValue.isEmpty()) |