sw/qa/extras/ooxmlimport/ooxmlimport.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit aec34ae349aee866db628e7a48cd1b5f6cc6dca1
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Mon Jul 15 11:12:45 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Mon Jul 15 21:46:46 2024 +0200

    tdf#158977: restore disable ooxmlimport unit test
    
    Some unit tests were disabled with
        tdf#136472 adjust ooxml import to handle first header/footer
    
    This one simply needed to be re-written to reliably test
    if it was laid out on page 1.
    
    Change-Id: Id749ff9d049691feba7fb155605291a2081a54c9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170505
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index eab15994c459..4fb26cb80367 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -172,7 +172,6 @@ CPPUNIT_TEST_FIXTURE(Test, testN751077)
     createSwDoc("n751077.docx");
 /*
 xray ThisComponent.DrawPage(1).getByIndex(0).String
-xray ThisComponent.DrawPage(1).getByIndex(0).Anchor.PageStyleName
 */
     uno::Reference<drawing::XShapes> xShapes(getShape(2), uno::UNO_QUERY);
     // The groupshape should be in the foreground, not the background.
@@ -180,11 +179,10 @@ xray 
ThisComponent.DrawPage(1).getByIndex(0).Anchor.PageStyleName
 
     uno::Reference<text::XTextRange> xShape(xShapes->getByIndex(0), 
uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(u"TEXT1
"_ustr, xShape->getString());
-    // we want to test the textbox is on the first page (it was put onto 
another page without the fix),
-    // use a small trick and instead of checking the page layout, check the 
page style
-    uno::Reference<text::XTextContent> xTextContent(xShape, uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(u"Standard"_ustr, 
getProperty<OUString>(xTextContent->getAnchor(), u"PageStyleName"_ustr));
-    // TODO - This is not a reliable way to determine if something is on first 
page
+
+    // test the textbox is on the first page (it was put onto another page 
without the fix)
+    const xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+    assertXPathContent(pXmlDoc, "//page[1]//OutlinerParaObject[1]//text"_ostr, 
"TEXT1");
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf129237)

Reply via email to