diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-10-04 09:24:42 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-10-14 12:53:10 +0000 |
commit | 21122a831aee1d548c9c539b27f15588675ceee5 (patch) | |
tree | 1a7902c91c31d6547a110f64a2b7fe59a27b27b8 | |
parent | 7310841ade1a5065441d32f8b342904c5ace9ea9 (diff) |
tdf#100830 drawingML import: handle <a:alphaModFix>
Fill transparency on the UI. Regression from commit
57450afb768c085df0ba2344aa94b5f843060178 (DOCX import: declare wps as a
supported feature, 2013-12-03), as the VML import handled this.
(cherry picked from commit ecfcee8b05e45ec82dec6ed417e9ac53d4d7b4ff)
Change-Id: I654b51d51448d25d400979a4a62189b86126ac01
Reviewed-on: https://gerrit.libreoffice.org/29560
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | include/oox/drawingml/fillproperties.hxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/fillpropertiesgroupcontext.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf100830.docx | bin | 0 -> 14219 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 6 |
5 files changed, 14 insertions, 0 deletions
diff --git a/include/oox/drawingml/fillproperties.hxx b/include/oox/drawingml/fillproperties.hxx index 3015424c1898..bed67d6fcc46 100644 --- a/include/oox/drawingml/fillproperties.hxx +++ b/include/oox/drawingml/fillproperties.hxx @@ -121,6 +121,7 @@ struct BlipFillProperties Color maDuotoneColors[2]; /// Duotone Colors ArtisticEffectProperties maEffect; /// Artistic effect, not supported by core. + OptValue<sal_Int32> moAlphaModFix; ///< Alpha Modulate Fixed Effect. /** Overwrites all members that are explicitly set in rSourceProps. */ void assignUsed( const BlipFillProperties& rSourceProps ); diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 9044b5d12866..c283212c9a1f 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -205,6 +205,7 @@ void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps ) maDuotoneColors[0].assignIfUsed( rSourceProps.maDuotoneColors[0] ); maDuotoneColors[1].assignIfUsed( rSourceProps.maDuotoneColors[1] ); maEffect.assignUsed( rSourceProps.maEffect ); + moAlphaModFix.assignIfUsed(rSourceProps.moAlphaModFix); } void FillProperties::assignUsed( const FillProperties& rSourceProps ) @@ -652,6 +653,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, } } } + + if (maBlipProps.moAlphaModFix.has()) + rPropMap.setProperty(SHAPEPROP_FillTransparency, static_cast<sal_Int16>(maBlipProps.moAlphaModFix.get() / PER_PERCENT)); } break; diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index ecfdb335f5e4..1bd514ff67ce 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -190,6 +190,9 @@ ContextHandlerRef BlipContext::onCreateContext( mrBlipProps.moBrightness = rAttribs.getInteger( XML_bright ); mrBlipProps.moContrast = rAttribs.getInteger( XML_contrast ); break; + case A_TOKEN( alphaModFix ): + mrBlipProps.moAlphaModFix = rAttribs.getInteger(XML_amt); + break; } return nullptr; } diff --git a/sw/qa/extras/ooxmlimport/data/tdf100830.docx b/sw/qa/extras/ooxmlimport/data/tdf100830.docx Binary files differnew file mode 100644 index 000000000000..a51b89026340 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf100830.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 8b7de5087ff5..59a015b15fc7 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -3245,6 +3245,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx") CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTableProperties, "HoriOrient")); } +DECLARE_OOXMLIMPORT_TEST(testTdf100830, "tdf100830.docx") +{ + // FillTransparence wasn't imported, this was 0. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(50), getProperty<sal_Int16>(getShape(1), "FillTransparence")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |