[Libreoffice-commits] core.git: oox/source sw/qa

lbenes lukebenes at hotmail.com
Fri Oct 7 07:10:53 UTC 2016


 oox/source/drawingml/fillproperties.cxx      |    2 +-
 sw/qa/extras/ooxmlimport/data/tdf100830.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |    2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ade43e6a86e4f864e771f4b3008a428bc10fa55f
Author: lbenes <lukebenes at hotmail.com>
Date:   Thu Oct 6 15:57:22 2016 -0400

    tdf#102997 Fix Error in OOXML Transparency Conversion Math
    
    This fixes the import logic for tdf#100830 to handle transparencies other than 50%.
    
    Change-Id: If4e2e369a9674488878bb0a4378d48292ea4e0cb
    Reviewed-on: https://gerrit.libreoffice.org/29581
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 2acf94f..ed8dbfc 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -655,7 +655,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
                     }
 
                     if (maBlipProps.moAlphaModFix.has())
-                        rPropMap.setProperty(ShapeProperty::FillTransparency, static_cast<sal_Int16>(maBlipProps.moAlphaModFix.get() / PER_PERCENT));
+                        rPropMap.setProperty(ShapeProperty::FillTransparency, static_cast<sal_Int16>(100 - (maBlipProps.moAlphaModFix.get() / PER_PERCENT)));
                 }
             break;
 
diff --git a/sw/qa/extras/ooxmlimport/data/tdf100830.docx b/sw/qa/extras/ooxmlimport/data/tdf100830.docx
old mode 100644
new mode 100755
index a51b890..6c43217
Binary files a/sw/qa/extras/ooxmlimport/data/tdf100830.docx and b/sw/qa/extras/ooxmlimport/data/tdf100830.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8752ee0..f42f1e6 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -3297,7 +3297,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx")
 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_ASSERT_EQUAL(static_cast<sal_Int16>(30), getProperty<sal_Int16>(getShape(1), "FillTransparence"));
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list