sw/qa/extras/ooxmlexport/ooxmlexport12.cxx |   58 ++++++++++++++++++++++-------
 1 file changed, 44 insertions(+), 14 deletions(-)

New commits:
commit 3cdfed5dba206c1b3e1c9de77432606a36fda53f
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Jul 26 20:04:05 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jul 27 08:04:36 2022 +0200

    CppunitTest_sw_ooxmlexport12: use more SwParaPortion::dumpAsXml()
    
    See commit feeed3e762cf077fbd9cf48f82e949365108ccc1
    (CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing,
    2022-04-07) for motivation.
    
    Change-Id: I7024b990f38fead082df9f200ec4a5865fbc093d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137481
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 5cdda2855e33..7719bfe65631 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -695,22 +695,28 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112202, 
"090716_Studentische_Arbeit_VWS.docx")
     // page 4 header: 1 table, 1 paragraph, with text
     assertXPath(pXmlDoc, "/root/page[4]/header/txt", 1);
     assertXPath(pXmlDoc, "/root/page[4]/header/tab", 1);
-    assertXPath(pXmlDoc, 
"/root/page[4]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion",
-                "Titel der studentischen Arbeit");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page[4]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+        "portion", "Titel der studentischen Arbeit");
     assertXPath(pXmlDoc, "/root/page[4]/header//anchored", 0);
 
     // page 5: same as page 4
     assertXPath(pXmlDoc, "/root/page[5]/header/txt", 1);
     assertXPath(pXmlDoc, "/root/page[5]/header/tab", 1);
-    assertXPath(pXmlDoc, 
"/root/page[5]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion",
-                "Titel der studentischen Arbeit");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page[5]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+        "portion", "Titel der studentischen Arbeit");
     assertXPath(pXmlDoc, "/root/page[5]/header//anchored", 0);
 
     // page 6: same as page 4
     assertXPath(pXmlDoc, "/root/page[6]/header/txt", 1);
     assertXPath(pXmlDoc, "/root/page[6]/header/tab", 1);
-    assertXPath(pXmlDoc, 
"/root/page[6]/header/tab/row[1]/cell[1]/txt[1]/Text", "Portion",
-                "Titel der studentischen Arbeit");
+    assertXPath(
+        pXmlDoc,
+        
"/root/page[6]/header/tab/row[1]/cell[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+        "portion", "Titel der studentischen Arbeit");
     assertXPath(pXmlDoc, "/root/page[6]/header//anchored", 0);
 }
 
@@ -2095,30 +2101,54 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, 
"tdf119952_negativeMargi
     //Check text of header/ footer
     CPPUNIT_ASSERT_EQUAL(
         OUString("f1"),
-        getXPath(pDump, "//page[1]/header/txt/anchored/fly/txt[1]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[1]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
     CPPUNIT_ASSERT_EQUAL(
         OUString("                f8"),
-        getXPath(pDump, "//page[1]/header/txt/anchored/fly/txt[8]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[1]/header/txt/anchored/fly/txt[8]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
     CPPUNIT_ASSERT_EQUAL(
         OUString("                f8"),
-        getXPath(pDump, "//page[1]/footer/txt/anchored/fly/txt[1]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[1]/footer/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
     CPPUNIT_ASSERT_EQUAL(
         OUString("f1"),
-        getXPath(pDump, "//page[1]/footer/txt/anchored/fly/txt[8]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[1]/footer/txt/anchored/fly/txt[8]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
 
     CPPUNIT_ASSERT_EQUAL(
         OUString("p1"),
-        getXPath(pDump, "//page[2]/header/txt/anchored/fly/txt[1]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[2]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
     CPPUNIT_ASSERT_EQUAL(
         OUString("p1"),
-        getXPath(pDump, "//page[2]/footer/txt/anchored/fly/txt[1]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[2]/footer/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
 
     CPPUNIT_ASSERT_EQUAL(
         OUString("  aaaa"),
-        getXPath(pDump, "//page[3]/header/txt/anchored/fly/txt[1]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[3]/header/txt/anchored/fly/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
     CPPUNIT_ASSERT_EQUAL(
         OUString("      eeee"),
-        getXPath(pDump, "//page[3]/header/txt/anchored/fly/txt[5]/Text", 
"Portion"));
+        getXPath(
+            pDump,
+            
"//page[3]/header/txt/anchored/fly/txt[5]/SwParaPortion/SwLineLayout/SwParaPortion",
+            "portion"));
 
     CPPUNIT_ASSERT_EQUAL(OUString("f1    f2      f3        f4          f5      
      f6            "
                                   "  f7                f8"),

Reply via email to