forked from pool/libreoffice
fixup of bsc1124869.patch OBS-URL: https://build.opensuse.org/request/show/703558 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=787
64 lines
2.6 KiB
Diff
64 lines
2.6 KiB
Diff
From dc75d3cc5f2797dd5a8675004302a52bda1210c6 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Tam=C3=A1s=20Zolnai?= <tamas.zolnai@collabora.com>
|
|
Date: Thu, 9 May 2019 13:03:13 +0200
|
|
Subject: PPTX: Fix import / export of image transparency
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Reviewed-on: https://gerrit.libreoffice.org/71916
|
|
Tested-by: Jenkins <ci@libreoffice.org>
|
|
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
|
|
(cherry picked from commit ae3aabdb951643af8d2f7aee9c9f900245e5b384)
|
|
|
|
Change-Id: Ib07c606083b833389fcb82aac57ca8535d6e861f
|
|
Reviewed-on: https://gerrit.libreoffice.org/72051
|
|
Tested-by: Jenkins
|
|
Reviewed-by: Andras Timar <andras.timar@collabora.com>
|
|
---
|
|
oox/source/drawingml/fillproperties.cxx | 5 +++++
|
|
oox/source/export/drawingml.cxx | 6 +++---
|
|
sd/qa/unit/data/odp/image_transparency.odp | Bin 0 -> 24448 bytes
|
|
sd/qa/unit/export-tests-ooxml1.cxx | 26 ++++++++++++++++++++++++++
|
|
4 files changed, 34 insertions(+), 3 deletions(-)
|
|
create mode 100644 sd/qa/unit/data/odp/image_transparency.odp
|
|
|
|
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
|
|
index b255116..a2fb6ee 100644
|
|
--- a/oox/source/drawingml/fillproperties.cxx
|
|
+++ b/oox/source/drawingml/fillproperties.cxx
|
|
@@ -755,6 +755,11 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
|
|
rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
|
|
}
|
|
}
|
|
+
|
|
+ if ( maBlipProps.moAlphaModFix.has() )
|
|
+ {
|
|
+ rPropMap.setProperty(PROP_Transparency, static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.get() / PER_PERCENT)));
|
|
+ }
|
|
}
|
|
rPropMap.setProperty(PROP_GraphicColorMode, eColorMode);
|
|
|
|
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
|
|
index a797adb..23065ec 100644
|
|
--- a/oox/source/export/drawingml.cxx
|
|
+++ b/oox/source/export/drawingml.cxx
|
|
@@ -1154,14 +1154,14 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference<beans::X
|
|
{
|
|
sal_Int16 nBright = 0;
|
|
sal_Int32 nContrast = 0;
|
|
- sal_Int32 nTransparence = 0;
|
|
+ sal_Int16 nTransparence = 0;
|
|
|
|
if (GetProperty(rXPropSet, "AdjustLuminance"))
|
|
nBright = mAny.get<sal_Int16>();
|
|
if (GetProperty(rXPropSet, "AdjustContrast"))
|
|
nContrast = mAny.get<sal_Int32>();
|
|
- if (GetProperty(rXPropSet, "FillTransparence"))
|
|
- nTransparence = mAny.get<sal_Int32>();
|
|
+ if (GetProperty(rXPropSet, "Transparency"))
|
|
+ nTransparence = mAny.get<sal_Int16>();
|
|
|
|
|
|
if (nBright || nContrast)
|