From befc0c2b0e0b3bf293a2446d71e38717ed53985b Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Mon, 22 Feb 2021 14:44:03 +0300 Subject: tdf#133473 Change SDRATTR_SHADOWSIZEX flag. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- include/svx/unoshprp.hxx | 4 ++-- sw/CppunitTest_sw_ooxmlimport2.mk | 1 + sw/qa/extras/ooxmlexport/data/tdf133473.docx | Bin 0 -> 83030 bytes sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 21 +++++++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf133473.docx diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index d356cefb64b5..840214f5e928 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -224,8 +224,8 @@ { u"" UNO_NAME_SHADOWTRANSPARENCE,SDRATTR_SHADOWTRANSPARENCE, ::cppu::UnoType::get(), 0, 0}, \ { u"" UNO_NAME_SHADOWXDIST, SDRATTR_SHADOWXDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ { u"" UNO_NAME_SHADOWYDIST, SDRATTR_SHADOWYDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ - { u"" UNO_NAME_SHADOWSIZEX, SDRATTR_SHADOWSIZEX, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ - { u"" UNO_NAME_SHADOWSIZEY, SDRATTR_SHADOWSIZEY, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { u"" UNO_NAME_SHADOWSIZEX, SDRATTR_SHADOWSIZEX, ::cppu::UnoType::get(), 0, 0}, \ + { u"" UNO_NAME_SHADOWSIZEY, SDRATTR_SHADOWSIZEY, ::cppu::UnoType::get(), 0, 0}, \ { u"" UNO_NAME_SHADOWBLUR, SDRATTR_SHADOWBLUR, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, diff --git a/sw/CppunitTest_sw_ooxmlimport2.mk b/sw/CppunitTest_sw_ooxmlimport2.mk index a7e718147b97..67c4077fcecd 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 047d9ebc31c1..6da14ef1a005 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -9,6 +9,11 @@ #include +#include +#include +#include +#include + #include #include #include @@ -122,6 +127,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(8664), frameRect.Width); } +DECLARE_OOXMLEXPORT_TEST(testTdf133473_shadowSize, "tdf133473.docx") +{ + uno::Reference 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(200000), nSize1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3