diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2021-05-26 08:47:38 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-05-26 17:09:37 +0200 |
commit | 7f9668926d03de947a73c0b3a5e2f6490701fcad (patch) | |
tree | 72a3913df27460b8e09b1f3643922db28ef71576 /include/editeng | |
parent | tdf#96061 Unset the highlight property (diff) | |
download | core-7f9668926d03de947a73c0b3a5e2f6490701fcad.tar.gz core-7f9668926d03de947a73c0b3a5e2f6490701fcad.zip |
Seperate SvxBackgroundColorItem from SvxColorItem
SvxBackgroundColorItem derivated from SfxPoolItem instead of
SvxColorItem.
Casting is common usage to control if object is this or not.
When we can cast SvxBackgroundColorItem to SvxColorItem we can not
seperate them anymore.
eg: Char color is a SvxColorItem and char background color is a
SvxBackgroundColorItem. They can be hold together and we should
understand they are different types.
Change-Id: I7b1879a1b00de26c0b8a2d9f8d658aa3aef75ecb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116135
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116183
Diffstat (limited to 'include/editeng')
-rw-r--r-- | include/editeng/colritem.hxx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx index 1eab79723577..8e081fc6aab1 100644 --- a/include/editeng/colritem.hxx +++ b/include/editeng/colritem.hxx @@ -61,17 +61,37 @@ public: }; // XXX: to be moved in a separate header. -class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SvxColorItem +class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SfxPoolItem { +private: + Color mColor; + public: static SfxPoolItem* CreateDefault(); SvxBackgroundColorItem(const sal_uInt16 nId); SvxBackgroundColorItem(const Color& rCol, const sal_uInt16 nId); + virtual ~SvxBackgroundColorItem() override; - virtual SvxBackgroundColorItem* Clone(SfxItemPool* pPool = nullptr) const override; + virtual bool operator==(const SfxPoolItem& rPoolItem) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override; + + virtual bool GetPresentation(SfxItemPresentation ePres, + MapUnit eCoreMetric, MapUnit ePresMetric, + OUString &rText, const IntlWrapper& rIntlWrapper) const override; + + virtual SvxBackgroundColorItem* Clone(SfxItemPool* pPool = nullptr) const override; + SvxBackgroundColorItem(SvxBackgroundColorItem const &) = default; // SfxPoolItem copy function dichotomy + + const Color& GetValue() const + { + return mColor; + } + + void SetValue(const Color& rNewColor); + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; #endif |