summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2022-06-17 16:51:22 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2022-06-26 22:15:02 +0200
commit415dc3bb1c03dbdbc3cbca274bc435ac7557ba2d (patch)
treec1af8f2e12bda4336d4c194513bcada671223746 /editeng/source
parent423f277cc0c185ff7eaf79aa9237585c52e0c652 (diff)
tdf#148820 sc: fix conditional formatted cell color
Store foreground color for color filtering, because in OOXML the foreground color is used for color filtering and we overwrote it with the background color which is used for conditional formatted cells too. Regression from commit: 6f908b48373b71d45c8119b296b0504fb586f6f8 (tdf#143104 Fix xlsx import/export of color filter colors) Change-Id: I737e6f1170851822a2689fa477db59e62f0d47fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136055 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/items/frmitems.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 4bbca9a2c0c1..c4c79dc0428b 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2832,6 +2832,7 @@ void SvxLineItem::SetLine( const SvxBorderLine* pNew )
SvxBrushItem::SvxBrushItem(sal_uInt16 _nWhich)
: SfxPoolItem(_nWhich)
, aColor(COL_TRANSPARENT)
+ , aFilterColor(COL_TRANSPARENT)
, nShadingValue(ShadingPattern::CLEAR)
, nGraphicTransparency(0)
, eGraphicPos(GPOS_NONE)
@@ -2842,6 +2843,7 @@ SvxBrushItem::SvxBrushItem(sal_uInt16 _nWhich)
SvxBrushItem::SvxBrushItem(const Color& rColor, sal_uInt16 _nWhich)
: SfxPoolItem(_nWhich)
, aColor(rColor)
+ , aFilterColor(COL_TRANSPARENT)
, nShadingValue(ShadingPattern::CLEAR)
, nGraphicTransparency(0)
, eGraphicPos(GPOS_NONE)
@@ -2852,6 +2854,7 @@ SvxBrushItem::SvxBrushItem(const Color& rColor, sal_uInt16 _nWhich)
SvxBrushItem::SvxBrushItem(const Graphic& rGraphic, SvxGraphicPosition ePos, sal_uInt16 _nWhich)
: SfxPoolItem(_nWhich)
, aColor(COL_TRANSPARENT)
+ , aFilterColor(COL_TRANSPARENT)
, nShadingValue(ShadingPattern::CLEAR)
, xGraphicObject(new GraphicObject(rGraphic))
, nGraphicTransparency(0)
@@ -2864,6 +2867,7 @@ SvxBrushItem::SvxBrushItem(const Graphic& rGraphic, SvxGraphicPosition ePos, sal
SvxBrushItem::SvxBrushItem(const GraphicObject& rGraphicObj, SvxGraphicPosition ePos, sal_uInt16 _nWhich)
: SfxPoolItem(_nWhich)
, aColor(COL_TRANSPARENT)
+ , aFilterColor(COL_TRANSPARENT)
, nShadingValue(ShadingPattern::CLEAR)
, xGraphicObject(new GraphicObject(rGraphicObj))
, nGraphicTransparency(0)
@@ -2877,6 +2881,7 @@ SvxBrushItem::SvxBrushItem(OUString aLink, OUString aFilter,
SvxGraphicPosition ePos, sal_uInt16 _nWhich)
: SfxPoolItem(_nWhich)
, aColor(COL_TRANSPARENT)
+ , aFilterColor(COL_TRANSPARENT)
, nShadingValue(ShadingPattern::CLEAR)
, nGraphicTransparency(0)
, maStrLink(std::move(aLink))
@@ -2890,6 +2895,7 @@ SvxBrushItem::SvxBrushItem(OUString aLink, OUString aFilter,
SvxBrushItem::SvxBrushItem(const SvxBrushItem& rItem)
: SfxPoolItem(rItem)
, aColor(rItem.aColor)
+ , aFilterColor(rItem.aFilterColor)
, nShadingValue(rItem.nShadingValue)
, xGraphicObject(rItem.xGraphicObject ? new GraphicObject(*rItem.xGraphicObject) : nullptr)
, nGraphicTransparency(rItem.nGraphicTransparency)
@@ -2903,6 +2909,7 @@ SvxBrushItem::SvxBrushItem(const SvxBrushItem& rItem)
SvxBrushItem::SvxBrushItem(SvxBrushItem&& rItem)
: SfxPoolItem(std::move(rItem))
, aColor(std::move(rItem.aColor))
+ , aFilterColor(std::move(rItem.aFilterColor))
, nShadingValue(std::move(rItem.nShadingValue))
, xGraphicObject(std::move(rItem.xGraphicObject))
, nGraphicTransparency(std::move(rItem.nGraphicTransparency))
@@ -3157,8 +3164,8 @@ bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
assert(SfxPoolItem::operator==(rAttr));
const SvxBrushItem& rCmp = static_cast<const SvxBrushItem&>(rAttr);
- bool bEqual = ( aColor == rCmp.aColor && eGraphicPos == rCmp.eGraphicPos &&
- nGraphicTransparency == rCmp.nGraphicTransparency);
+ bool bEqual = ( aColor == rCmp.aColor && aFilterColor == rCmp.aFilterColor &&
+ eGraphicPos == rCmp.eGraphicPos && nGraphicTransparency == rCmp.nGraphicTransparency);
if ( bEqual )
{
@@ -3366,6 +3373,7 @@ void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBrushItem"));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("color"), BAD_CAST(aColor.AsRGBHexString().toUtf8().getStr()));
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("filtercolor"), BAD_CAST(aFilterColor.AsRGBHexString().toUtf8().getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("shadingValue"), BAD_CAST(OString::number(nShadingValue).getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("link"), BAD_CAST(maStrLink.toUtf8().getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("filter"), BAD_CAST(maStrFilter.toUtf8().getStr()));