From 8cc70d18c4507a746607fe5922b7c5e94b7f7579 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 16 Feb 2022 20:02:01 +0100 Subject: sd theme: add doc model for shape fill color In preparation of adding UNO API for this. Change-Id: Iecb2e44c43bca9e892fcb6242870ec12faa48be5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130050 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- svx/source/xoutdev/xattr.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 0539e19664e7..81d10a97061c 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -279,7 +279,8 @@ XColorItem::XColorItem(TypedWhichId _nWhich, const Color& rTheColor) XColorItem::XColorItem(const XColorItem& rItem) : NameOrIndex(rItem), - aColor(rItem.aColor) + aColor(rItem.aColor), + maThemeColor(rItem.maThemeColor) { } @@ -291,7 +292,8 @@ XColorItem* XColorItem::Clone(SfxItemPool* /*pPool*/) const bool XColorItem::operator==(const SfxPoolItem& rItem) const { return ( NameOrIndex::operator==(rItem) && - static_cast(rItem).aColor == aColor ); + static_cast(rItem).aColor == aColor ) && + static_cast(rItem).maThemeColor == maThemeColor; } const Color& XColorItem::GetColorValue() const @@ -323,11 +325,17 @@ void XColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const { (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWCOLOR")); } + else if (Which() == XATTR_FILLCOLOR) + { + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("XATTR_FILLCOLOR")); + } (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aColor"), BAD_CAST(aColor.AsRGBHexString().toUtf8().getStr())); NameOrIndex::dumpAsXml(pWriter); + maThemeColor.dumpAsXml(pWriter); + (void)xmlTextWriterEndElement(pWriter); } @@ -1913,7 +1921,9 @@ void XFillColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const { (void)xmlTextWriterStartElement(pWriter, BAD_CAST("XFillColorItem")); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetColorValue().AsRGBHexString().toUtf8().getStr())); + + XColorItem::dumpAsXml(pWriter); + (void)xmlTextWriterEndElement(pWriter); } -- cgit