summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-08-21 18:28:23 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-08-29 20:17:21 +0000
commitc128724679d0be1defe74a4b6bf45f0235cac6a5 (patch)
treedbef2ada39a8489c2d3cc89dcf2752ddeb9c7eb0 /svx
parentc5eb0eb4537182e0c8bc3c50acf30e69c454778d (diff)
tdf#92379: svx: don't overwrite fo:background-color on ODF import
getSvxBrushItemFromSourceSet() is called once for each property of a frame style that is set, and the "solid" fill-style is set by first applying the BackColorRGB and then BackTransparency property. So there is an intermediate state that has fill-style NONE but a XFillColorItem set - don't reset the color to white in that case! Apparently writerfilter generally relies on the current reset-to-AUTO implementation (loads of test failures), so for now limit the fix for when we know that a frame style is imported from ODF. (regression from 3d399b0e45720354fc64dc3d121ee486e01eff89) (cherry picked from commit 79fb61efb847405fa47235002b52ee8efad5e339) tdf#92379: sw: unit test for frame style background color (cherry picked from commit 982537d77c2db463cc053cfdcd522530a3834c9e) Change-Id: Ia987fe586ec819a1f3cd85acdbfb03c74ca0ec2c Reviewed-on: https://gerrit.libreoffice.org/18037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unobrushitemhelper.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx
index 42b3d5f7c139..1ae4c1475ef2 100644
--- a/svx/source/unodraw/unobrushitemhelper.cxx
+++ b/svx/source/unodraw/unobrushitemhelper.cxx
@@ -192,7 +192,7 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchI
}
//UUUU
-SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents)
+SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
{
const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rSourceSet.GetItem(XATTR_FILLSTYLE, bSearchInParents)));
@@ -201,8 +201,8 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
// no fill, still need to rescue the evtl. set RGB color, but use as transparent color (we have drawing::FillStyle_NONE)
Color aFillColor(static_cast< const XFillColorItem& >(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents)).GetColorValue());
- // when fill style is none, then don't allow anything other than 0 or auto.
- if (aFillColor.GetColor() != 0)
+ // for writerfilter: when fill style is none, then don't allow anything other than 0 or auto.
+ if (!bXMLImportHack && aFillColor.GetColor() != 0)
aFillColor.SetColor(COL_AUTO);
aFillColor.SetTransparency(0xff);