summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-09-11 00:25:27 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-09-11 00:26:57 -0400
commitd66ae92ade617b390c879ac99d9bbca8a7b6617f (patch)
tree5515cbba1fd187595e4e0d0c14120b2cf7df59e5
parent02b0d09ee02ea3ed3b489c2637f87c5e42aea71b (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
-rw-r--r--sc/source/filter/oox/formulabuffer.cxx5
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())