summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-09-22 20:20:15 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-09-23 08:49:48 +0200
commitc097ff3fb2c6a58b0217213d12e69ea7833bf06f (patch)
treecae1c56db197ab91358b92554e3ddff444f315dc /sw
parent0c6c95b545b6d4bced699e6f7d9e1d9c679b893e (diff)
CppunitTest_sw_ww8export: use more SwParaPortion::dumpAsXml()
See commit feeed3e762cf077fbd9cf48f82e949365108ccc1 (CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing, 2022-04-07) for motivation. Change-Id: Ia3fb5d9d85817d6dd1efe9973b5cc8dfcafe40ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140451 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index a92d4899194b..2ccd11c4cd65 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -253,10 +253,10 @@ DECLARE_WW8EXPORT_TEST(testTdf75539_relativeWidth, "tdf75539_relativeWidth.doc")
//divide everything by 10 to give a margin of error for rounding etc.
sal_Int32 pageWidth = parseDump("/root/page[1]/body/infos/bounds", "width").toInt32()/10;
CPPUNIT_ASSERT_EQUAL_MESSAGE("Page width", sal_Int32(9354/10), pageWidth);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("100% width line", pageWidth, parseDump("/root/page[1]/body/txt[2]/Special", "nWidth").toInt32()/10);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("50% width line", pageWidth/2, parseDump("/root/page[1]/body/txt[4]/Special", "nWidth").toInt32()/10);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("25% width line", pageWidth/4, parseDump("/root/page[1]/body/txt[6]/Special", "nWidth").toInt32()/10);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("10% width line", pageWidth/10, parseDump("/root/page[1]/body/txt[8]/Special", "nWidth").toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("100% width line", pageWidth, parseDump("/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("50% width line", pageWidth/2, parseDump("/root/page[1]/body/txt[4]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("25% width line", pageWidth/4, parseDump("/root/page[1]/body/txt[6]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("10% width line", pageWidth/10, parseDump("/root/page[1]/body/txt[8]/SwParaPortion/SwLineLayout/SwLinePortion", "width").toInt32()/10);
}
DECLARE_WW8EXPORT_TEST(testN757905, "n757905.doc")
@@ -315,7 +315,7 @@ DECLARE_WW8EXPORT_TEST(testN823651, "n823651.doc")
DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc")
{
- OUString aText = parseDump("/root/page/body/txt[3]/Special[@nType='PortionType::Number']", "rText");
+ OUString aText = parseDump("/root/page/body/txt[3]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand");
// This was 1.1.
CPPUNIT_ASSERT_EQUAL(OUString("2.1"), aText);
}
@@ -323,7 +323,7 @@ DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc")
DECLARE_WW8EXPORT_TEST(testListNolevel, "list-nolevel.doc")
{
// Similar to fdo#36868, numbering portions had wrong values.
- OUString aText = parseDump("/root/page/body/txt[1]/Special[@nType='PortionType::Number']", "rText");
+ OUString aText = parseDump("/root/page/body/txt[1]/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']", "expand");
// PortionType::Number was completely missing.
CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
}
@@ -612,10 +612,10 @@ DECLARE_WW8EXPORT_TEST(testLayoutHanging, "fdo68967.doc")
DECLARE_WW8EXPORT_TEST(testfdo68963, "fdo68963.doc")
{
// The problem was that the text was not displayed.
- CPPUNIT_ASSERT ( !parseDump("/root/page/body/tab/row[2]/cell[1]/txt/Special", "rText").isEmpty() );
- CPPUNIT_ASSERT_EQUAL( OUString("Topic 1"), parseDump("/root/page/body/tab/row[2]/cell[1]/txt/Special", "rText") );
+ CPPUNIT_ASSERT ( !parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand").isEmpty() );
+ CPPUNIT_ASSERT_EQUAL( OUString("Topic 1"), parseDump("/root/page/body/tab/row[2]/cell[1]/txt/SwParaPortion/SwLineLayout/SwFieldPortion", "expand") );
// all crossreference bookmarks should have a target. Shouldn't be any "Reference source not found" in the xml
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), parseDump("/root/page/body/txt[24]/Special[2]","rText").indexOf("Reference source not found"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), parseDump("/root/page/body/txt[24]/SwParaPortion/SwLineLayout/SwFieldPortion[2]","expand").indexOf("Reference source not found"));
}
#endif