diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-11 00:25:27 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-11 00:26:57 -0400 |
commit | d66ae92ade617b390c879ac99d9bbca8a7b6617f (patch) | |
tree | 5515cbba1fd187595e4e0d0c14120b2cf7df59e5 /sc | |
parent | 02b0d09ee02ea3ed3b489c2637f87c5e42aea71b (diff) |
Fix crashers on xlsx import, due to shared formula range being wrong.
Shared formula range that Excel gives is incorrect about half the time.
It's better to ignore that altogether.
Change-Id: I2302c6dd1b5883e32305d4c511f942bf4cebca3a
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()) |