summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/fillproperties.cxx
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2020-07-14 22:52:56 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-08-07 10:29:11 +0200
commit0ff6f5ad44a5fb9903c9a905d2ec55248ee75315 (patch)
tree7a08bbec2df1343eb07efd6f357c95264eafff12 /oox/source/drawingml/fillproperties.cxx
parentc5a90c8843e635317078307a26ab898b6cd4c95d (diff)
tdf#128345 pptx export: add transparence gradient in solid fill
In case of solid color fill a transparence gradient was not saved. OOXML has no separate element for gradient transparency but has transparency in color gradient stop elements. The patch detects a transparence gradient, combines it with the fill color and exports it as gradFill element. The import was already correct, besides a wrong start or end value in case of a symmetric gradient, which becomes AXIAL in LibreOffice. (cherry picked from commit d187f22b7ff73954e1da39fb954c64bc315298cb) Conflicts: oox/source/drawingml/fillproperties.cxx sd/qa/unit/export-tests-ooxml1.cxx Change-Id: I4243656821629f90125d0408a38165a8a29e6e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100286 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/source/drawingml/fillproperties.cxx')
-rw-r--r--oox/source/drawingml/fillproperties.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index caa54b82ca34..f963f103d2c8 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -529,10 +529,8 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
aGradient.StartColor = sal_Int32(aStartColor.getColor( rGraphicHelper, nPhClr ));
aGradient.EndColor = sal_Int32(aEndColor.getColor( rGraphicHelper, nPhClr ));
- if( aStartColor.hasTransparency() )
- nStartTrans = aStartColor.getTransparency()*255/100;
- if( aEndColor.hasTransparency() )
- nEndTrans = aEndColor.getTransparency()*255/100;
+ nStartTrans = aStartColor.hasTransparency() ? aStartColor.getTransparency()*255/100 : 0;
+ nEndTrans = aEndColor.hasTransparency() ? aEndColor.getTransparency()*255/100 : 0;
aGradient.Border = rtl::math::round(100*nBorder);
}