summaryrefslogtreecommitdiff
path: root/writerfilter/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-02-11 09:51:14 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-02-11 12:52:23 +0100
commitbf25e69f8f657d5e3bcdd0bd54c5fa0d66ec85fe (patch)
treefb39228f0e197fed10c072cc7df9591c169c163c /writerfilter/qa
parent52ee72a0e5ea6e590a98d3388e1cf12fa75583b6 (diff)
DOCX import: fix margins of inline shapes with effects, imported as Draw shapes
Effects have an extent, and unhandled effects (like this blurred shadow) need to take space in the margin of the shape to make sure they use the correct amount of space in the layout. This was working in general, but not in case the importer decided to import the shape as Draw shape + the shape was inline. (And also disable a new CppunitTest_sw_uibase_shells test on Windows, which is only stable on Linux, it seems.) Change-Id: I9d0531d9393d8c2cd274e6f54bbbfe8024bf270f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88427 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'writerfilter/qa')
-rw-r--r--writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx17
-rw-r--r--writerfilter/qa/cppunittests/dmapper/data/draw-shape-inline-effect.docxbin0 -> 16534 bytes
2 files changed, 17 insertions, 0 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
index 4c694ac3d083..73f863b02100 100644
--- a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
@@ -68,6 +68,23 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupShapeRotation)
// it.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1221), nVertPosition);
}
+
+CPPUNIT_TEST_FIXTURE(Test, testDrawShapeInlineEffect)
+{
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "draw-shape-inline-effect.docx";
+ getComponent() = loadFromDesktop(aURL);
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ sal_Int32 nBottomMargin = 0;
+ xShape->getPropertyValue("BottomMargin") >>= nBottomMargin;
+ // 273 in mm100 is 98425 EMUs from the file.
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 273
+ // - Actual : 0
+ // i.e. the layout result had less pages than expected (compared to Word).
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(273), nBottomMargin);
+}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/qa/cppunittests/dmapper/data/draw-shape-inline-effect.docx b/writerfilter/qa/cppunittests/dmapper/data/draw-shape-inline-effect.docx
new file mode 100644
index 000000000000..3eb5b0e2f448
--- /dev/null
+++ b/writerfilter/qa/cppunittests/dmapper/data/draw-shape-inline-effect.docx
Binary files differ