summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-08-25 19:08:00 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-08-29 20:15:46 +0000
commitf27cba26afe416de48b7ff2cded69ae60ae14fd4 (patch)
tree77164149cee6f353830a6ca25a8ebe2cc988783a /sw/source
parent89e2e2f59738adee91282c19e7d43e98784fdacb (diff)
tdf#92379: sw: ODF import: fix fo:background-color="transparent"
The problem is that if the FillStyle is NONE, setting only ParaBackTransparent but not ParaBackColor does absolutely nothing. This means that if a parent style sets a background color, then a derived style cannot override it to be transparent. Cause is that getSvxBrushItemFromSourceSet() defaults to setting a 0xFF transparency on the SvxBrushItem. There is still a problem that getSvxBrushItemFromSourceSet() sets the pool default item's color and that is also exported to ODF again as draw:fill-color, but together with draw:fill="none" it should not cause harm, at least for consumers that prefer draw:fill attributes like LO >= 4.4. (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa) Change-Id: I5312901166a0e6f0cf02369b173dc8498e4113ed (cherry picked from commit f38f018053a43d1f7b473103e936abe2d4d8fa05) Reviewed-on: https://gerrit.libreoffice.org/18043 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/unocore/unostyle.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index a4c670bbcf87..28f25eb6fef9 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1764,7 +1764,11 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
aChangedBrushItem.PutValue(aValue, nMemberId);
- if(!(aChangedBrushItem == aOriginalBrushItem))
+ if (!(aChangedBrushItem == aOriginalBrushItem) ||
+ // 0xff is already the default - but if BackTransparent is set
+ // to true, it must be applied in the item set on ODF import
+ // to potentially override parent style, which is unknown yet
+ (MID_GRAPHIC_TRANSPARENT == nMemberId && aValue.has<bool>() && aValue.get<bool>()))
{
setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet);
}