diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-29 02:13:28 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-30 01:03:55 +0100 |
commit | 7f5aab85e3ce0320e449b17782f7cc284b48344e (patch) | |
tree | 5edcbe918477ca036710def01699ccc41a060172 /sc/inc | |
parent | 2b2c67c557d427d37a18a66f8acad6fdca726c6f (diff) |
implement basic support for icon sets
already supports ooxml import
Change-Id: I3e54aa1632a78f853bb13a3a4f76e9d66ea0b9ac
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/colorscale.hxx | 75 | ||||
-rw-r--r-- | sc/inc/conditio.hxx | 8 | ||||
-rw-r--r-- | sc/inc/fillinfo.hxx | 12 |
3 files changed, 92 insertions, 3 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 92f88f3359b4..685fde1fc7d1 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -179,6 +179,33 @@ struct SC_DLLPUBLIC ScDataBarFormatData boost::scoped_ptr<ScColorScaleEntry> mpLowerLimit; }; +enum ScIconSetType +{ + IconSet_3Arrows, + IconSet_3ArrowsGray, + IconSet_3Flags, + IconSet_3TrafficLights1, + IconSet_3TrafficLights2, + IconSet_3Signs, + IconSet_3Symbols, + IconSet_3Symbols2, + IconSet_4Arrows, + IconSet_4ArrowsGray, + IconSet_4RedToBlack, + IconSet_4Rating, + IconSet_4TrafficLights, + IconSet_5Arrows, + IconSet_5ArrowsGray, + IconSet_5Ratings, + IconSet_5Quarters +}; + +struct ScIconSetMap { + const char* pName; + ScIconSetType eType; + sal_Int32 nElements; +}; + class SC_DLLPUBLIC ScColorFormat : public ScFormatEntry { public: @@ -281,6 +308,54 @@ private: boost::scoped_ptr<ScDataBarFormatData> mpFormatData; }; +struct ScIconSetFormatData +{ + ScIconSetType eIconSetType; + boost::ptr_vector<ScColorScaleEntry> maEntries; +}; + +class SC_DLLPUBLIC ScIconSetFormat : public ScColorFormat +{ +private: + typedef boost::ptr_vector<ScColorScaleEntry>::iterator iterator; + typedef boost::ptr_vector<ScColorScaleEntry>::const_iterator const_iterator; + +public: + ScIconSetFormat(ScDocument* pDoc); + ScIconSetFormat(ScDocument* pDoc, const ScIconSetFormat& rFormat); + + virtual ScColorFormat* Clone(ScDocument* pDoc = NULL) const; + + ScIconSetInfo* GetIconSetInfo(const ScAddress& rAddr) const; + + void SetIconSetData( ScIconSetFormatData* pData ); + const ScIconSetFormatData* GetIconSetData() const; + + virtual void DataChanged(const ScRange& rRange); + virtual void UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab); + virtual void UpdateReference( UpdateRefMode eUpdateRefMode, + const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); + + virtual condformat::ScFormatEntryType GetType() const; + + static ScIconSetMap* getIconSetMap(); + +#if DUMP_FORMAT_INFO + virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const; +#endif +private: + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + + double GetMinValue() const; + double GetMaxValue() const; + double CalcValue(double nMin, double nMax, ScIconSetFormat::const_iterator& itr) const; + + boost::scoped_ptr<ScIconSetFormatData> mpFormatData; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index b9b24c44060e..a18235ba7dbb 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -79,6 +79,7 @@ enum ScConditionMode class ScConditionalFormat; struct ScDataBarInfo; +struct ScIconSetInfo; namespace condformat { @@ -87,7 +88,8 @@ enum ScFormatEntryType { CONDITION, COLORSCALE, - DATABAR + DATABAR, + ICONSET }; } @@ -96,10 +98,12 @@ struct ScCondFormatData { ScCondFormatData(): pColorScale(NULL), - pDataBar(NULL) {} + pDataBar(NULL), + pIconSet(NULL) {} Color* pColorScale; ScDataBarInfo* pDataBar; + ScIconSetInfo* pIconSet; rtl::OUString aStyleName; }; diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index 838255ef1236..bbed41fc10f0 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -31,6 +31,7 @@ #include <svx/framelinkarray.hxx> #include "global.hxx" +#include "colorscale.hxx" class SfxItemSet; class SvxBrushItem; @@ -91,6 +92,12 @@ struct ScDataBarInfo } }; +struct ScIconSetInfo +{ + sal_Int32 nIconIndex; + ScIconSetType eIconSetType; +}; + struct CellInfo { ScBaseCell* pCell; @@ -99,6 +106,7 @@ struct CellInfo const SfxItemSet* pConditionSet; const Color* pColorScale; const ScDataBarInfo* pDataBar; + const ScIconSetInfo* pIconSet; const SvxBrushItem* pBackground; @@ -135,12 +143,14 @@ struct CellInfo CellInfo(): pColorScale(NULL), - pDataBar(NULL) {} + pDataBar(NULL), + pIconSet(NULL) {} ~CellInfo() { delete pColorScale; delete pDataBar; + delete pIconSet; } }; |