sc/source/filter/oox/formulabuffer.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
New commits: commit 1c9dd88f1c814af52d9b57b8352233ffd6d15242 Author: Kohei Yoshida <[email protected]> Date: Fri Nov 8 14:49:44 2013 -0500 Group formula cells if we can, to avoid cloning of token array instances. Change-Id: I584e6d0c34f972c1ae5105a80d201f32dd8590d9 diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index eb1892b..4bdb6ae 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -189,7 +189,24 @@ void applyCellFormulas( if (p) { // Use the cached version to avoid re-compilation. - ScFormulaCell* pCell = new ScFormulaCell(&rDoc.getDoc(), aPos, p->mpCell->GetCode()->Clone()); + + ScFormulaCell* pCell = NULL; + if (p->mnRow + 1 == aPos.Row()) + { + // Put them in the same formula group. + ScFormulaCell& rPrev = *p->mpCell; + ScFormulaCellGroupRef xGroup = rPrev.GetCellGroup(); + if (!xGroup) + // Last cell is not grouped yet. Start a new group. + xGroup = rPrev.CreateCellGroup(p->mnRow, 1, false); + + ++xGroup->mnLength; + + pCell = new ScFormulaCell(&rDoc.getDoc(), aPos, xGroup); + } + else + pCell = new ScFormulaCell(&rDoc.getDoc(), aPos, p->mpCell->GetCode()->Clone()); + rDoc.setFormulaCell(aPos, pCell); // Update the cache. _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
