summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-07-15 11:12:45 -0400
committerJustin Luth <jluth@mail.com>2024-07-15 21:46:46 +0200
commitaec34ae349aee866db628e7a48cd1b5f6cc6dca1 (patch)
treeafbb42ccbbe854cfe8d5f582586b56680cb0a557
parent9fdb7eca0c14c2449ab185014d132035d985b5d2 (diff)
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 <jluth@mail.com> Tested-by: Jenkins
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
1 files changed, 4 insertions, 6 deletions
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\n"_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)