diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-04 10:24:45 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-11 08:01:24 +0200 |
commit | caad0f6c79909f2fb4865ac8395fc1798b8be7a6 (patch) | |
tree | 3e88a00425eadfebb08ca673d929ea60a4c6a0c7 /sc/inc | |
parent | integrate color formats into conditional formats (diff) | |
download | core-caad0f6c79909f2fb4865ac8395fc1798b8be7a6.tar.gz core-caad0f6c79909f2fb4865ac8395fc1798b8be7a6.zip |
adjust import/export code to merged conditional formats
Change-Id: Ib9cd4e09e55ff2413db8e1daf45624d695e3113d
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/colorscale.hxx | 53 | ||||
-rw-r--r-- | sc/inc/conditio.hxx | 6 | ||||
-rw-r--r-- | sc/inc/document.hxx | 9 | ||||
-rw-r--r-- | sc/inc/table.hxx | 9 |
4 files changed, 22 insertions, 55 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 32be4a60ffed..fd2322b6fafc 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -99,6 +99,22 @@ struct ScDataBarFormatData meAxisPosition(databar::AUTOMATIC), mbOnlyBar(false){} + ScDataBarFormatData(const ScDataBarFormatData& r): + maPositiveColor(r.maPositiveColor), + mbGradient(r.mbGradient), + mbNeg(r.mbNeg), + meAxisPosition(r.meAxisPosition), + mbOnlyBar(r.mbOnlyBar) + { + if(r.mpNegativeColor) + mpNegativeColor.reset(new Color(*r.mpNegativeColor)); + + if(r.mpLowerLimit) + mpLowerLimit.reset( new ScColorScaleEntry(*r.mpLowerLimit)); + if(r.mpUpperLimit) + mpUpperLimit.reset( new ScColorScaleEntry(*r.mpUpperLimit)); + } + /** * Color for all Positive Values and if mbNeg == false also for negative ones */ @@ -145,7 +161,6 @@ class SC_DLLPUBLIC ScColorFormat : public ScFormatEntry { public: ScColorFormat(ScDocument* pDoc); - ScColorFormat(ScDocument* pDoc, const ScColorFormat& rFormat); virtual ~ScColorFormat(); void SetRange(const ScRangeList& rList); @@ -157,7 +172,6 @@ public: protected: void getValues( std::vector<double>& rValues ) const; - ScRangeList maRanges; ScConditionalFormat* mpParent; }; @@ -221,39 +235,4 @@ private: boost::scoped_ptr<ScDataBarFormatData> mpFormatData; }; -class SC_DLLPUBLIC ScColorFormatList -{ -private: - typedef boost::ptr_vector<ScColorFormat> ColorFormatContainer; - ColorFormatContainer maColorScaleFormats; -public: - ScColorFormatList() {} - ScColorFormatList(const ScColorFormatList& rList); - - typedef ColorFormatContainer::iterator iterator; - typedef ColorFormatContainer::const_iterator const_iterator; - - ScColorFormat* GetFormat(sal_uInt32 nFormat); - void AddFormat( ScColorFormat* pFormat ); - - void DataChanged(const ScRange& rRange); - void UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab); - void UpdateReference( UpdateRefMode eUpdateRefMode, - const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); - - iterator begin(); - const_iterator begin() const; - iterator end(); - const_iterator end() const; - - size_t size() const; -}; - -// see http://www.boost.org/doc/libs/1_49_0/libs/ptr_container/doc/tutorial.html#cloneability -//for MSVC we need: -inline ScFormatEntry* new_clone( const ScColorFormat& rFormat ) -{ - return rFormat.Clone(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index b11261868ed4..6874c7815645 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -259,7 +259,7 @@ class SC_DLLPUBLIC ScConditionalFormat typedef boost::ptr_vector<ScFormatEntry> CondFormatContainer; CondFormatContainer maEntries; bool bIsUsed; // temporary at Save - ScRangeListRef pRanges; // Ranges for conditional format + ScRangeList maRanges; // Ranges for conditional format public: ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument); @@ -270,8 +270,8 @@ public: ScConditionalFormat* Clone(ScDocument* pNewDoc = NULL) const; void AddEntry( ScFormatEntry* pNew ); - void AddRangeInfo( const ScRangeListRef& rRanges ); - const ScRangeListRef& GetRangeInfo() const { return pRanges; } + void AddRange( const ScRangeList& rRanges ); + const ScRangeList& GetRange() const { return maRanges; } bool IsEmpty() const { return maEntries.empty(); } size_t size() const { return maEntries.size(); } diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 90d2f768b1ec..cc2780f694aa 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -97,7 +97,6 @@ class ScChartListenerCollection; class ScConditionalFormat; class ScConditionalFormatList; class ScColorFormat; -class ScColorFormatList; class ScDBCollection; class ScDBData; class ScDetOpData; @@ -1165,7 +1164,7 @@ public: const ScPatternAttr* GetSelectionPattern( const ScMarkData& rMark, bool bDeep = true ); ScPatternAttr* CreateSelectionPattern( const ScMarkData& rMark, bool bDeep = true ); - const ScConditionalFormat* GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; + SC_DLLPUBLIC ScConditionalFormat* GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; SC_DLLPUBLIC const SfxItemSet* GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; const SfxPoolItem* GetEffItem( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const; @@ -1196,8 +1195,7 @@ public: void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark ); void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark ); - SC_DLLPUBLIC sal_uLong AddCondFormat( const ScConditionalFormat& rNew, SCTAB nTab ); - SC_DLLPUBLIC sal_uLong AddColorFormat( ScColorFormat* pNew, SCTAB nTab ); + SC_DLLPUBLIC sal_uLong AddCondFormat( ScConditionalFormat* pNew, SCTAB nTab ); SC_DLLPUBLIC void FindConditionalFormat( sal_uLong nKey, SCTAB nTab, ScRangeList& rRanges ); SC_DLLPUBLIC void FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab ); void ConditionalChanged( sal_uLong nKey, SCTAB nTab ); @@ -1208,9 +1206,6 @@ public: SC_DLLPUBLIC ScConditionalFormatList* GetCondFormList( SCTAB nTab ) const; - SC_DLLPUBLIC const ScColorFormatList* GetColorScaleList(SCTAB nTab) const; - SC_DLLPUBLIC ScColorFormatList* GetColorScaleList(SCTAB nTab); - ScValidationDataList* GetValidationList() const { return pValidationList; } diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 3e3572095832..4c5d69759eed 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -73,8 +73,6 @@ class ScProgress; class ScRangeList; class ScSheetEvents; class ScSortInfoArray; -class ScColorFormatList; -class ScColorFormat; class ScConditionalFormat; class ScConditionalFormatList; class ScStyleSheet; @@ -174,7 +172,6 @@ private: mutable ScRangeName* mpRangeName; boost::scoped_ptr<ScConditionalFormatList> mpCondFormatList; - boost::scoped_ptr<ScColorFormatList> mpColorFormatList; ScNotes maNotes; @@ -800,11 +797,7 @@ public: ScConditionalFormatList* GetCondFormList(); const ScConditionalFormatList* GetCondFormList() const; - sal_uLong AddCondFormat( const ScConditionalFormat& rNew ); - sal_uLong AddColorFormat( ScColorFormat* pNew ); - ScColorFormatList* GetColorFormatList(); - const ScColorFormatList* GetColorFormatList() const; - + sal_uLong AddCondFormat( ScConditionalFormat* pNew ); private: void FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, |