include/svx/unoshprp.hxx                     |    4 ++--
 sw/CppunitTest_sw_ooxmlimport2.mk            |    1 +
 sw/qa/extras/ooxmlexport/data/tdf133473.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx   |   21 +++++++++++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 408f3007def50d5b99c0cd5afeedcaabe5291561
Author:     Gülşah Köse <gulsah.k...@collabora.com>
AuthorDate: Mon Feb 22 14:44:03 2021 +0300
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Mar 10 10:11:13 2021 +0100

    tdf#133473 Change SDRATTR_SHADOWSIZEX flag.
    
    SDRATTR_SHADOWSIZEX holds a percentage value. So we
    shouldn't use METRIC_ITEM.
    
    Change-Id: I9f1a20d5871f60d2899ef7d525f4cf837b0a9088
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111311
    Tested-by: Jenkins
    Reviewed-by: Gülşah Köse <gulsah.k...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112241

diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index 04a9213dc2a9..20a49f1f4d62 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -224,8 +224,8 @@
     { u"" UNO_NAME_SHADOWTRANSPARENCE,SDRATTR_SHADOWTRANSPARENCE, 
::cppu::UnoType<sal_Int16>::get(),    0,      0}, \
     { u"" UNO_NAME_SHADOWXDIST,       SDRATTR_SHADOWXDIST,        
::cppu::UnoType<sal_Int32>::get(),    0,      0, 
PropertyMoreFlags::METRIC_ITEM}, \
     { u"" UNO_NAME_SHADOWYDIST,       SDRATTR_SHADOWYDIST,        
::cppu::UnoType<sal_Int32>::get(),    0,      0, 
PropertyMoreFlags::METRIC_ITEM}, \
-    { u"" UNO_NAME_SHADOWSIZEX,       SDRATTR_SHADOWSIZEX,        
::cppu::UnoType<sal_Int32>::get(),    0,      0, 
PropertyMoreFlags::METRIC_ITEM}, \
-    { u"" UNO_NAME_SHADOWSIZEY,       SDRATTR_SHADOWSIZEY,        
::cppu::UnoType<sal_Int32>::get(),    0,      0, 
PropertyMoreFlags::METRIC_ITEM}, \
+    { u"" UNO_NAME_SHADOWSIZEX,       SDRATTR_SHADOWSIZEX,        
::cppu::UnoType<sal_Int32>::get(),    0,      0}, \
+    { u"" UNO_NAME_SHADOWSIZEY,       SDRATTR_SHADOWSIZEY,        
::cppu::UnoType<sal_Int32>::get(),    0,      0}, \
     { u"" UNO_NAME_SHADOWBLUR,        SDRATTR_SHADOWBLUR,         
::cppu::UnoType<sal_Int32>::get(),    0,      0, 
PropertyMoreFlags::METRIC_ITEM},
 
 
diff --git a/sw/CppunitTest_sw_ooxmlimport2.mk 
b/sw/CppunitTest_sw_ooxmlimport2.mk
index 97fc1e7b1e6d..99dff26e44f6 100644
--- a/sw/CppunitTest_sw_ooxmlimport2.mk
+++ b/sw/CppunitTest_sw_ooxmlimport2.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlimport2, \
     tl \
     vcl \
     svxcore \
+    svl\
 ))
 
 $(eval $(call gb_CppunitTest_use_externals,sw_ooxmlimport2,\
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133473.docx 
b/sw/qa/extras/ooxmlexport/data/tdf133473.docx
new file mode 100644
index 000000000000..c351db950231
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133473.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index e4b4ab0b0a83..f532794e3874 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -9,6 +9,11 @@
 
 #include <swmodeltestbase.hxx>
 
+#include <svx/svddef.hxx>
+#include <svx/unoapi.hxx>
+#include <svx/sdmetitm.hxx>
+#include <svx/svdobj.hxx>
+
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
@@ -96,6 +101,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf140137, "tdf140137.docx")
     // Don't throw exception during load
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf133473_shadowSize, "tdf133473.docx")
+{
+    uno::Reference<drawing::XShape> xShape = getShape(1);
+
+    SdrObject* pObj(GetSdrObjectFromXShape(xShape));
+    const SfxItemSet& rSet = pObj->GetMergedItemSet();
+    sal_Int32 nSize1 = rSet.Get(SDRATTR_SHADOWSIZEX).GetValue();
+
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 200000
+    // - Actual  : 113386
+    // I.e. Shadow size will be smaller than actual.
+
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(200000), nSize1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to