[Libreoffice-commits] core.git: sw/qa

Justin Luth justin_luth at sil.org
Tue Apr 11 04:39:59 UTC 2017


 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 56fd725b9d5ac2a990715d30cd477b01c34781db
Author: Justin Luth <justin_luth at sil.org>
Date:   Mon Apr 10 16:47:58 2017 +0300

    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 <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+    uno::Reference<beans::XPropertySet> 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<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> 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")
 {
 /*


More information about the Libreoffice-commits mailing list