diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-23 08:34:13 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-23 08:38:17 +0100 |
commit | 9513e13686f011b008764b3c5f184be47b9f4f5f (patch) | |
tree | f496f6b6c59b50103387beae9318d8b073bc3bbe /sc/source/core/data/conditio.cxx | |
parent | fb81adcda850b7456dbc274a37a2f12237c6ab82 (diff) |
fix above/below equal average ods import/export
Change-Id: I1c305c67772b46cede6b4da3e79578f2f1a8ee89
Diffstat (limited to 'sc/source/core/data/conditio.cxx')
-rw-r--r-- | sc/source/core/data/conditio.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index cecb844b7f47..772a190b4f95 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -933,7 +933,7 @@ bool ScConditionEntry::IsBottomNPercent( double nArg ) const return true; } -bool ScConditionEntry::IsBelowAverage( double nArg ) const +bool ScConditionEntry::IsBelowAverage( double nArg, bool bEqual ) const { FillCache(); @@ -944,13 +944,13 @@ bool ScConditionEntry::IsBelowAverage( double nArg ) const nSum += itr->first * itr->second; } - if(nVal1) + if(bEqual) return (nArg <= nSum/mpCache->nValueItems); else return (nArg < nSum/mpCache->nValueItems); } -bool ScConditionEntry::IsAboveAverage( double nArg ) const +bool ScConditionEntry::IsAboveAverage( double nArg, bool bEqual ) const { FillCache(); @@ -961,7 +961,7 @@ bool ScConditionEntry::IsAboveAverage( double nArg ) const nSum += itr->first * itr->second; } - if(nVal1) + if(bEqual) return (nArg >= nSum/mpCache->nValueItems); else return (nArg > nSum/mpCache->nValueItems); @@ -1084,10 +1084,12 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const bValid = IsBottomNPercent( nArg ); break; case SC_COND_ABOVE_AVERAGE: - bValid = IsAboveAverage( nArg ); + case SC_COND_ABOVE_EQUAL_AVERAGE: + bValid = IsAboveAverage( nArg, eOp == SC_COND_ABOVE_EQUAL_AVERAGE ); break; case SC_COND_BELOW_AVERAGE: - bValid = IsBelowAverage( nArg ); + case SC_COND_BELOW_EQUAL_AVERAGE: + bValid = IsBelowAverage( nArg, eOp == SC_COND_BELOW_EQUAL_AVERAGE ); break; case SC_COND_ERROR: case SC_COND_NOERROR: |