From 08ed74c89f7f018167b858e74cc30ae0272fae6c Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 4 Jun 2012 05:03:42 +0200 Subject: integrate color formats into conditional formats Change-Id: I3c235f6dd0b69d3fc560910fcc890d2c80c995c0 --- sc/inc/colorscale.hxx | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'sc/inc/colorscale.hxx') diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index d8b294c13e0b..32be4a60ffed 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -31,6 +31,7 @@ #include #include #include +#include "conditio.hxx" #include @@ -140,13 +141,7 @@ struct ScDataBarFormatData boost::scoped_ptr mpLowerLimit; }; -enum ScColorFormatType -{ - COLORSCALE, - DATABAR -}; - -class SC_DLLPUBLIC ScColorFormat +class SC_DLLPUBLIC ScColorFormat : public ScFormatEntry { public: ScColorFormat(ScDocument* pDoc); @@ -157,19 +152,13 @@ public: const ScRangeList& GetRange() const; virtual void DataChanged(const ScRange& rRange) = 0; - virtual void UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab) = 0; - virtual void UpdateReference( UpdateRefMode eUpdateRefMode, - const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) = 0; - - virtual ScColorFormat* Clone(ScDocument* pDoc = NULL) const = 0; - - virtual ScColorFormatType GetType() const = 0; + virtual void SetParent(ScConditionalFormat* pParent); protected: void getValues( std::vector& rValues ) const; ScRangeList maRanges; - ScDocument* mpDoc; + ScConditionalFormat* mpParent; }; class SC_DLLPUBLIC ScColorScaleFormat : public ScColorFormat @@ -198,7 +187,7 @@ public: virtual void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); - virtual ScColorFormatType GetType() const; + virtual condformat::ScFormatEntryType GetType() const; typedef ColorScaleEntries::iterator iterator; typedef ColorScaleEntries::const_iterator const_iterator; iterator begin(); @@ -224,7 +213,7 @@ public: virtual void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); - virtual ScColorFormatType GetType() const; + virtual condformat::ScFormatEntryType GetType() const; private: double getMin(double nMin, double nMax) const; double getMax(double nMin, double nMax) const; @@ -262,7 +251,7 @@ public: // see http://www.boost.org/doc/libs/1_49_0/libs/ptr_container/doc/tutorial.html#cloneability //for MSVC we need: -inline ScColorFormat* new_clone( const ScColorFormat& rFormat ) +inline ScFormatEntry* new_clone( const ScColorFormat& rFormat ) { return rFormat.Clone(); } -- cgit