From f654980aebb5d41a83dd7de94ec2ebf0173c67a7 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 21 May 2012 15:47:23 +0200 Subject: initial support for percentile in data bars/color scales Color Scales look correctly but in the databar code seems to be an error if all values are positive. Change-Id: I0bfb277df50021bd20a4b13a5da342670102b649 --- sc/inc/colorscale.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sc/inc/colorscale.hxx') diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 997c2a0c6f36..9f4d02fb406a 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -32,6 +32,8 @@ #include #include +#include + //TODO: merge this with conditio.hxx class ScDocument; @@ -49,6 +51,7 @@ private: bool mbMin; bool mbMax; bool mbPercent; + bool mbPercentile; public: ScColorScaleEntry(double nVal, const Color& rCol); ScColorScaleEntry(const ScColorScaleEntry& rEntry); @@ -65,11 +68,13 @@ public: bool GetMin() const; bool GetMax() const; bool GetPercent() const; + bool GetPercentile() const; bool HasFormula() const; const ScTokenArray* GetFormula() const; void SetMin(bool bMin); void SetMax(bool bMax); void SetPercent(bool bPercent); + void SetPercentile(bool bPercentile); }; namespace databar @@ -160,6 +165,8 @@ public: virtual ScColorFormatType GetType() const = 0; protected: + void getValues( std::vector& rValues ) const; + ScRangeList maRanges; ScDocument* mpDoc; }; @@ -175,6 +182,7 @@ private: void calcMinMax(double& nMin, double& nMax) const; bool CheckEntriesForRel(const ScRange& rRange) const; + double CalcValue(double nMin, double nMax, ColorScaleEntries::const_iterator& rItr) const; public: ScColorScaleFormat(ScDocument* pDoc); ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleFormat& rFormat); -- cgit