diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-08-22 15:57:41 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-08-22 17:21:19 +0200 |
commit | 505cbb9c3d2771a12c989515663cc1eb73dd0c2f (patch) | |
tree | 451268b966d388b5c8d3a2af77fc712583f491a0 | |
parent | 69057064d8957804c76e623d57c103c3413b7cbc (diff) |
tdf#127085: FILESAVE: Transparency is lost after RT
Change-Id: I22ba83b5cc00f84112a3755898ee2be58337afd6
Reviewed-on: https://gerrit.libreoffice.org/77963
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r-- | oox/source/export/drawingml.cxx | 10 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf127085.docx | bin | 0 -> 34263 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 7 |
3 files changed, 14 insertions, 3 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index d4b35c8988f6..6f975a298e50 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1274,14 +1274,18 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference<beans::X { sal_Int16 nBright = 0; sal_Int32 nContrast = 0; - sal_Int16 nTransparence = 0; + sal_Int32 nTransparence = 0; if (GetProperty(rXPropSet, "AdjustLuminance")) nBright = mAny.get<sal_Int16>(); if (GetProperty(rXPropSet, "AdjustContrast")) nContrast = mAny.get<sal_Int32>(); - if (GetProperty(rXPropSet, "Transparency")) - nTransparence = mAny.get<sal_Int16>(); + // Used for shapes with picture fill + if (GetProperty(rXPropSet, "FillTransparence")) + nTransparence = mAny.get<sal_Int32>(); + // Used for pictures + if (nTransparence == 0 && GetProperty(rXPropSet, "Transparency")) + nTransparence = static_cast<sal_Int32>(mAny.get<sal_Int16>()); if (nBright || nContrast) diff --git a/sw/qa/extras/ooxmlexport/data/tdf127085.docx b/sw/qa/extras/ooxmlexport/data/tdf127085.docx Binary files differnew file mode 100644 index 000000000000..65556fe38abd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf127085.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index e59e65e19312..5666f4fae730 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -579,6 +579,13 @@ DECLARE_OOXMLIMPORT_TEST(testInvalidDateFormField, "invalid_date_form_field.docx CPPUNIT_ASSERT_EQUAL(int(3), nIndex); } +DECLARE_OOXMLEXPORT_TEST(tdf127085, "tdf127085.docx") +{ + // Fill transparency was lost during export + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(50), getProperty<sal_Int16>(xShape, "FillTransparence")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |