summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-02-22 14:44:03 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-11 21:48:44 +0100
commit36538b33413b24241920d8c4d873beb5c671e13f (patch)
treeea06e990133e0fea82f79929200c6d79acd2bb00 /sw
parent99890e4450ceae45f30da1667c85da73deabfdc9 (diff)
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.kose@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112241 Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112262
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_ooxmlimport2.mk1
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf133473.docxbin0 -> 83030 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx21
3 files changed, 22 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_ooxmlimport2.mk b/sw/CppunitTest_sw_ooxmlimport2.mk
index f47d7e35830b..6df866aebadf 100644
--- a/sw/CppunitTest_sw_ooxmlimport2.mk
+++ b/sw/CppunitTest_sw_ooxmlimport2.mk
@@ -33,6 +33,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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf133473.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 1e28459cc0b0..71e313d4c545 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>
@@ -86,6 +91,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: */