From fccd44a01e2092b587bbab43f5c5f56cd7ece4cd Mon Sep 17 00:00:00 2001 From: László Németh Date: Mon, 4 May 2015 14:50:49 +0200 Subject: tdf#91077 unit tests for shape import of discarded DOCX header/footer Change-Id: I3e78e3104af97eed91c102e9ca5546e0785c5f8c --- sw/qa/extras/ooxmlimport/data/n779627b.docx | Bin 0 -> 5805 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 sw/qa/extras/ooxmlimport/data/n779627b.docx 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 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n779627b.docx 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 textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference 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 xShapeProperties( getShape(1), uno::UNO_QUERY ); uno::Reference xShapeDescriptor(xShapeProperties, uno::UNO_QUERY); -- cgit