summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-05-26 08:47:38 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2021-05-26 09:04:37 +0200
commit350d40417fe2cb56e16116f12216d08b9f2705b0 (patch)
treefd747136949ce7e3e7ebd51241a5250299223816 /include
parent3b3ba7065acd3ba783e56b568d67ace7dc352371 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/colritem.hxx24
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