diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-06-19 12:16:38 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-06-21 10:31:23 +0200 |
commit | 954403938f00645d92520efc4433c440a133c0b9 (patch) | |
tree | e7e83437f9a55fc846bb546296f472c3e41aa289 /sc/inc/document.hxx | |
parent | f46f871f3170eb0d5a6522b7425c2390b601df5a (diff) |
discard cached cell values if the cell changes
FormulaGroupContext is actually a cache of cell results for OpenCL,
but the cached values are not always properly discarded. Happens e.g.
with testFormulaDepTracking in sc_ucalc fails if OpenCL is forced for
it (i.e. with mnOpenCLMinimumFormulaGroupSize disabled), because
a SetString() call for a cell doesn't invalidate the cache.
This obviously reduces the cache hit rate a bit, but according to my
tests it's not that bad (in fact the cache doesn't seem to get used
that often, so I even wonder if it's worth it).
Change-Id: Ia7ef2214956861d26ca3a42b84f9fecbff8316d0
Reviewed-on: https://gerrit.libreoffice.org/56087
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/inc/document.hxx')
-rw-r--r-- | sc/inc/document.hxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index fcd09a1214de..ad371bd73cd8 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -353,9 +353,11 @@ private: rtl::Reference<ScPoolHelper> mxPoolHelper; std::shared_ptr<svl::SharedStringPool> mpCellStringPool; - std::shared_ptr<sc::FormulaGroupContext> mpFormulaGroupCxt; std::unique_ptr<sc::DocumentLinkManager> mpDocLinkMgr; + std::shared_ptr<sc::FormulaGroupContext> mpFormulaGroupCxt; + bool mbFormulaGroupCxtBlockDiscard; + ScCalcConfig maCalcConfig; SfxUndoManager* mpUndoManager; @@ -1118,6 +1120,9 @@ public: svl::SharedString GetSharedString( const ScAddress& rPos ) const; std::shared_ptr<sc::FormulaGroupContext>& GetFormulaGroupContext(); + void DiscardFormulaGroupContext(); + void BlockFormulaGroupContextDiscard( bool block ) + { mbFormulaGroupCxtBlockDiscard = block; } SC_DLLPUBLIC void GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rString ); FormulaError GetStringForFormula( const ScAddress& rPos, OUString& rString ); |