diff options
author | Eike Rathke <erack@redhat.com> | 2018-12-14 12:25:36 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-12-14 16:13:45 +0100 |
commit | 77ca13a212a570f7b8c369f468b6dfa08d4ab6e0 (patch) | |
tree | af7e1639241da505cdfdf232fa823b2b55e59da2 /sc/inc/subtotal.hxx | |
parent | 98e84dc591e23bd8e43c7c6d5ec6511eafa91900 (diff) |
Use ScFunctionData and thus Welford in Consolidation
Change-Id: I83972b07dafadf87f7322897332bbdf0cf58afd3
Reviewed-on: https://gerrit.libreoffice.org/65162
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/inc/subtotal.hxx')
-rw-r--r-- | sc/inc/subtotal.hxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sc/inc/subtotal.hxx b/sc/inc/subtotal.hxx index 2e2811e54815..377531330c29 100644 --- a/sc/inc/subtotal.hxx +++ b/sc/inc/subtotal.hxx @@ -62,21 +62,23 @@ private: class ScFunctionData { public: + ScFunctionData() : meFunc(SUBTOTAL_FUNC_NONE), mbError(false) {} ScFunctionData( ScSubTotalFunc eFn ) : meFunc(eFn), mbError(false) {} - void update( double fNewVal ); + + void update( double fNewVal ); /// Check getError() after (!) obtaining the result. - double getResult(); - bool getError() const { return mbError; } - ScSubTotalFunc getFunc() const { return meFunc; } - void setError() { mbError = true; } + double getResult(); + bool getError() const { return mbError; } + ScSubTotalFunc getFunc() const { return meFunc; } + void setError() { mbError = true; } private: - WelfordRunner maWelford; - ScSubTotalFunc const meFunc; - bool mbError; + WelfordRunner maWelford; + ScSubTotalFunc meFunc; + bool mbError; - double& getValueRef() { return maWelford.mfMean; } - sal_uInt64& getCountRef() { return maWelford.mnCount; } + double& getValueRef() { return maWelford.mfMean; } + sal_uInt64& getCountRef() { return maWelford.mnCount; } }; #endif |