diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-14 12:34:20 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-14 19:25:42 -0400 |
commit | 5dd2e45e65641134309265db30c9d5f304d0a583 (patch) | |
tree | 196c80fb7ae82a85b18d19b56a4f3d13fb3a8ea7 /sc/inc/document.hxx | |
parent | 25763e59625ce83de4b82927359108f9e7878744 (diff) |
Avoid wholesale rebuilding of formula groups at re-calc time.
And do it once when importing xls, xlsx, and ods documents.
Although xls(x) file formats support shared formula natively, it's
still beneficial to re-group it as some old xls documents limit the
length of shared formula span to only 64, or some don't use shared
formulas at all even though they could. And re-grouping just once
is not terribly expensive.
Change-Id: Iff9c605d19baa187553ddab6af8b9fbd4c366d7d
Diffstat (limited to 'sc/inc/document.hxx')
-rw-r--r-- | sc/inc/document.hxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 8b82fb77aa04..c74c6c8349d3 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -798,12 +798,23 @@ public: formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_DEFAULT ); /** - * Takes ownership of pCell + * Set formula cell, and transfer its ownership to the document. This call + * attempts to group the passed formula cell with the adjacent cells or + * cell groups if appropriate. * * @return pCell if it was successfully inserted, NULL otherwise. pCell * is deleted automatically on failure to insert. */ SC_DLLPUBLIC ScFormulaCell* SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell ); + + /** + * Set formula cell, and transfer its ownership to the document. Unlike + * SetFormulaCell(), this call will <i>not</i> attempt to group the passed + * formula cell with the adjacent cells or cell groups. + * + * @return true if the cell is inserted, false otherwise. The caller + * should delete the cell instance if the method returns false. + */ SC_DLLPUBLIC bool SetGroupFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell ); SC_DLLPUBLIC void InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, @@ -1801,7 +1812,7 @@ public: SC_DLLPUBLIC void CalcFormulaTree( bool bOnlyForced = false, bool bProgressBar = true, bool bSetAllDirty = true ); void ClearFormulaTree(); - void RebuildFormulaGroups(); + SC_DLLPUBLIC void RebuildFormulaGroups(); void AppendToFormulaTrack( ScFormulaCell* pCell ); void RemoveFromFormulaTrack( ScFormulaCell* pCell ); void TrackFormulas( sal_uLong nHintId = SC_HINT_DATACHANGED ); |