diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2019-03-21 10:41:06 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2019-03-21 13:06:43 +0100 |
commit | e53f380cbae0741ee4b39483a6422898bb580d28 (patch) | |
tree | ac54fdfd05cd92bb53074d4b164ec87eef55d8a3 /cui/source/options/cfgchart.hxx | |
parent | ddf1e93c740901503c92e289c70cb4d54c38dd6e (diff) |
Make SvxChartColorTableItem more const
SvxChartColorTableItem has non-const members (aka modifiers)
which is bad for SfxItems in general, see comments in change.
Adapt SvxChartColorTableItem and it's usage in
SvxDefaultColorOptPage as needed.
This is also preparation for possible SfxItem refactoring
Change-Id: Ia7982b4e7bbfa736229223e55ce63e02143b8cf7
Reviewed-on: https://gerrit.libreoffice.org/69499
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'cui/source/options/cfgchart.hxx')
-rw-r--r-- | cui/source/options/cfgchart.hxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cui/source/options/cfgchart.hxx b/cui/source/options/cfgchart.hxx index 91adbf17cda3..debb2372d81c 100644 --- a/cui/source/options/cfgchart.hxx +++ b/cui/source/options/cfgchart.hxx @@ -79,7 +79,11 @@ public: // items - +// Make Item read-only (no non-const access methods). Two reasons: +// (1) Preparation for Item refactor +// (2) Dangerous due to SfxItem may not be what you expect (e.g. when +// ::Set in SfxItemSet, not your instance may be used there, no control +// about what will happen wothout deep knowledge about SfxItems/SfxItemSets) class SvxChartColorTableItem : public SfxPoolItem { public: @@ -87,11 +91,8 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; - void SetOptions( SvxChartOptions* pOpts ) const; const SvxChartColorTable & GetColorList() const { return m_aColorTable;} - SvxChartColorTable & GetColorList() { return m_aColorTable;} - void ReplaceColorByIndex( size_t _nIndex, const XColorEntry & _rEntry ); private: SvxChartColorTable m_aColorTable; |