summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2022-01-17 15:00:13 +0100
committerLászló Németh <nemeth@numbertext.org>2022-02-03 08:59:10 +0100
commitb8925251e48534706c6960a54c320d3879317321 (patch)
tree837c19f3690236cf172c4622def978b5ec7df119 /oox
parent61f8ac1db7b4e3dbdc8e2d1e32a867e5cb699afb (diff)
tdf#146822 OOXML: fix export of the transparency in hatch fill
The transparency value of the hatch was not exported. Follow-up to commit 001afbed910b7e565f602c1b11b1b4538cd59442 "tdf#127989 OOXML: fix import of transparent hatching". Change-Id: I9b82a3422de8e4f85c534f861c45c0c097ceb02f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128504 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/fillproperties.cxx2
-rw-r--r--oox/source/export/drawingml.cxx15
2 files changed, 13 insertions, 4 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 5d17c321d0f8..2b682bcd1b99 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -812,6 +812,8 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
{
eFillStyle = FillStyle_HATCH;
rPropMap.setProperty( ShapeProperty::FillHatch, createHatch( maPatternProps.moPattPreset.get(), aColor.getColor( rGraphicHelper, nPhClr ) ) );
+ if( aColor.hasTransparency() )
+ rPropMap.setProperty( ShapeProperty::FillTransparency, aColor.getTransparency() );
// Set background color for hatch
if(maPatternProps.maPattBgColor.isUsed())
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 09ca9c22915a..87bbe81bd88a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1658,12 +1658,19 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs
{
mpFS->startElementNS(XML_a, XML_pattFill, XML_prst, GetHatchPattern(rHatch));
+ sal_Int32 nAlpha = MAX_PERCENT;
+ if (GetProperty(rXPropSet, "FillTransparence"))
+ {
+ sal_Int32 nTransparency = 0;
+ mAny >>= nTransparency;
+ nAlpha = (MAX_PERCENT - (PER_PERCENT * nTransparency));
+ }
+
mpFS->startElementNS(XML_a, XML_fgClr);
- WriteColor(::Color(ColorTransparency, rHatch.Color));
+ WriteColor(::Color(ColorTransparency, rHatch.Color), nAlpha);
mpFS->endElementNS( XML_a , XML_fgClr );
::Color nColor = COL_WHITE;
- sal_Int32 nAlpha = 0;
if ( GetProperty( rXPropSet, "FillBackground" ) )
{
@@ -1671,13 +1678,13 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs
mAny >>= isBackgroundFilled;
if( isBackgroundFilled )
{
- nAlpha = MAX_PERCENT;
-
if( GetProperty( rXPropSet, "FillColor" ) )
{
mAny >>= nColor;
}
}
+ else
+ nAlpha = 0;
}
mpFS->startElementNS(XML_a, XML_bgClr);