From fccd44a01e2092b587bbab43f5c5f56cd7ece4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= Date: Mon, 4 May 2015 14:50:49 +0200 Subject: [PATCH] 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 0000000000000000000000000000000000000000..187371520c058fa1dfbf4c844bc28400a58b14b0 GIT binary patch literal 5805 zcmb7Iby(B;7aloMa)_ja7Z?ZwNhKA8Igsv<8UmwxAP5LZ$7qx;Nhv7_5s{K^6jWNJ zK>?}XFyUUW-ruw5v*)`%zVFWG#CzUzlwerclmGw#53p&Fbu~|;;fVkS05FLS08jwv z0J>LfZJgjXPB+w$c5p|1ZZ~Tybv1kd7Tsl8^`qnLMhL*bUcdqXzI@fkh$%KhNCUPG zg4;N+z2ZCThjNiL_B#c?`n-XkYVGc=oQlH~$MLIpN-XAvL8d#)o(#9M^{f=`S)WaF zsWdJ(?%*rw=dd0DdFV~dj#%-g#uOw2UpyE#Zb_ovC!S}ggL0@soa2R;Aa^9I(?F&$vZ;EA67KxJd=Gv3FR z?#KkuMFT;WzQxZR38yb@_T3>T#=|iZY%zQjQS z*2A5TqFA*e9#zT3jExStOZxGh*uq%9{|&w7=>gcpji6|h>tVspB_(tO2+$D#0GMpE zu6}v=_Jxm*fT^vCl7p?CBhMGVhZ)GKOBwyc??(_ngV_D?%9<`Zh=rH{0NHT}6I%!P zpF$XhdVIYZLK)zi!n~d$Y@zB`$Qlc9wj@*0^%>=w=YJGP-|1po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.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);