Kaydet (Commit) d66ae92a authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 02b0d09e
......@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment