summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorDaniel Arato (NISZ) <arato.daniel@nisz.hu>2020-09-07 11:50:53 +0200
committerLászló Németh <nemeth@numbertext.org>2020-09-11 10:19:18 +0200
commit8ee88230c110ae90b439a52bc2906d6c5383967f (patch)
treea4ab2cc478e9efe6c41373fe8fdd327401192227 /sw
parent46187510e383d62ee7bae8f8332322d7c3b0c61e (diff)
tdf#135660 DOCX import: fix OLE icon wrap distance
The text wrap distance (also sometimes called "margin") of OLE VML icons used to be thrown away when a .docx file is opened. Change-Id: I79837421470dde5e68e916f87924b170ebf1d734 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102159 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf135660.docxbin0 -> 20134 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135660.docx b/sw/qa/extras/ooxmlexport/data/tdf135660.docx
new file mode 100644
index 000000000000..2309c9b0ac09
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135660.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 104e867a33ba..5aad7cc44f0e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -674,6 +674,26 @@ DECLARE_OOXMLEXPORT_TEST(testImageSpaceSettings, "tdf135047_ImageSpaceSettings.f
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distR", "90170");
}
+// TODO: change this to an export test once wrap distance export (TDF#135663) is implemented
+DECLARE_OOXMLIMPORT_TEST(testTdf13660, "tdf135660.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ const uno::Reference<drawing::XShape> xShape = getShape(1);
+ const uno::Reference<beans::XPropertySet> xOLEProps(xShape, uno::UNO_QUERY_THROW);
+ sal_Int32 nWrapDistanceLeft = -1;
+ sal_Int32 nWrapDistanceRight = -1;
+ sal_Int32 nWrapDistanceTop = -1;
+ sal_Int32 nWrapDistanceBottom = -1;
+ xOLEProps->getPropertyValue("LeftMargin") >>= nWrapDistanceLeft;
+ xOLEProps->getPropertyValue("RightMargin") >>= nWrapDistanceRight;
+ xOLEProps->getPropertyValue("TopMargin") >>= nWrapDistanceTop;
+ xOLEProps->getPropertyValue("BottomMargin") >>= nWrapDistanceBottom;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Left wrap distance is wrong", static_cast<sal_Int32>(0), nWrapDistanceLeft);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Right wrap distance is wrong", static_cast<sal_Int32>(400), nWrapDistanceRight);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Top wrap distance is wrong", static_cast<sal_Int32>(300), nWrapDistanceTop);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Bottom wrap distance is wrong", static_cast<sal_Int32>(199), nWrapDistanceBottom);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */