From 56fd725b9d5ac2a990715d30cd477b01c34781db Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Mon, 10 Apr 2017 16:47:58 +0300 Subject: restore missing ooxmlimport unit test: n757890.docx This test was lost while round-trippable tests were moved into ooxmlexport8. commit 086550313260d9fa45b91dc705b21bb9b51ce0b8 This test doesn't round-trip because it checks for a frame, and frames are turned into something else during export. Change-Id: If0e9776a83b0ee98c56039b4cd43b674198779e7 Reviewed-on: https://gerrit.libreoffice.org/36388 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f8c5ec9feecf..027c00a8b1cf 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -283,6 +283,26 @@ DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx") CPPUNIT_ASSERT(bFoundGet); } +DECLARE_OOXMLIMPORT_TEST(testN757890, "n757890.docx") +{ + // The w:pStyle token affected the text outside the textbox. + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xPara->getPropertyValue("ParaStyleName") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), aValue); + + // This wan't centered + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + sal_Int16 nValue; + xFrame->getPropertyValue("HoriOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue); +} + DECLARE_OOXMLIMPORT_TEST(testN751077, "n751077.docx") { /* -- cgit