summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-05-04 14:50:49 +0200
committerLászló Németh <laszlo.nemeth@collabora.com>2015-05-04 14:59:23 +0200
commitfccd44a01e2092b587bbab43f5c5f56cd7ece4cd (patch)
tree01646418afb352c07ba2532932f0efdc746ffd81
parentda0c3b50c79697dd595b00922ede004b9f2960f4 (diff)
tdf#91077 unit tests for shape import of discarded DOCX header/footer
Change-Id: I3e78e3104af97eed91c102e9ca5546e0785c5f8c
-rw-r--r--sw/qa/extras/ooxmlimport/data/n779627b.docxbin0 -> 5805 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx16
2 files changed, 14 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n779627b.docx b/sw/qa/extras/ooxmlimport/data/n779627b.docx
new file mode 100644
index 000000000000..187371520c05
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/n779627b.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index eebdc086bc97..c9c03686baf6 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -839,8 +839,20 @@ DECLARE_OOXMLIMPORT_TEST(testN779627, "n779627.docx")
sal_Int32(0), nLeftMargin);
/*
- * Another problem tested with this document is that the roundrect is
- * centered vertically and horizontally.
+ * Another problem tested with this document is the unnecessary loading of the shapes
+ * anchored to a discarded header or footer
+ */
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
+ CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), drawPage->getCount());
+}
+
+DECLARE_OOXMLIMPORT_TEST(testN779627b, "n779627b.docx")
+{
+ /*
+ * Another problem tested with the original n779627.docx document (before removing its unnecessary
+ * shape loading) is that the roundrect is centered vertically and horizontally.
*/
uno::Reference<beans::XPropertySet> xShapeProperties( getShape(1), uno::UNO_QUERY );
uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xShapeProperties, uno::UNO_QUERY);