sw/qa/extras/layout/layout.cxx |  108 +++++++++++++++++++++++++++--------------
 1 file changed, 73 insertions(+), 35 deletions(-)

New commits:
commit 6b92b144219acbbb43d0dfa9cd7c28aa1c16b6e9
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Apr 13 08:05:49 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Apr 13 08:52:47 2022 +0200

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

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 288288c90b46..42fbd769250f 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -104,12 +104,17 @@ void SwLayoutWriter::CheckRedlineSectionsHidden()
     discardDumpedLayout();
     xmlDocUniquePtr pXmlDoc = parseLayoutDump();
     assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", 
"paraPropsNodeIndex", "12");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", 
"PortionType::Para");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", 
"folah");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
+                "type", "PortionType::Para");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
+                "portion", "folah");
     assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/merged", 
"paraPropsNodeIndex", "20");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", 
"nType",
-                "PortionType::Para");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", 
"Portion", "folah");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
+                "type", "PortionType::Para");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/SwParaPortion[1]",
+                "portion", "folah");
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
@@ -2241,40 +2246,73 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, 
testRedlineSections)
     xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
     CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlNodes));
     xmlXPathFreeObject(pXmlObj);
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", 
"PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", 
"PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o");
-
-    assertXPath(pXmlDoc, 
"/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]",
-                "nType", "PortionType::Para");
-    assertXPath(pXmlDoc, 
"/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]",
-                "Portion", "FRAME");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", 
"nType",
-                "PortionType::Para");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", 
"Portion", "bar");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[2]/Text[1]", 
"nType",
-                "PortionType::Para");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[2]/Text[1]", 
"Portion", "baz");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", 
"PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "b");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", 
"PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "Portion", 
"lah");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[1]", 
"nType",
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]", "type",
                 "PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[1]", 
"Portion", "fo");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[2]", 
"nType",
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "fo");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]", "type",
                 "PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[2]", 
"Portion", "o");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[2]/Text[1]", 
"nType",
-                "PortionType::Para");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[2]/Text[1]", 
"Portion", "bar");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[1]", 
"nType",
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[1]/SwParaPortion/SwLineLayout/child::*[2]",
+                "portion", "o");
+
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
+                "SwLineLayout/child::*[1]",
+                "type", "PortionType::Para");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/SwParaPortion/"
+                "SwLineLayout/child::*[1]",
+                "portion", "FRAME");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
+                "type", "PortionType::Para");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "bar");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
+                "type", "PortionType::Para");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[1]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "baz");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]", "type",
                 "PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[1]", 
"Portion", "b");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[2]", 
"nType",
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "b");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]", "type",
                 "PortionType::Text");
-    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[2]", 
"Portion", "lah");
+    assertXPath(pXmlDoc, 
"/root/page[1]/body/txt[2]/SwParaPortion/SwLineLayout/child::*[2]",
+                "portion", "lah");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
+                "type", "PortionType::Text");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "fo");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]",
+                "type", "PortionType::Text");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout/child::*[2]",
+                "portion", "o");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
+                "type", "PortionType::Para");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[2]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "bar");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]",
+                "type", "PortionType::Text");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[1]",
+                "portion", "b");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]",
+                "type", "PortionType::Text");
+    assertXPath(pXmlDoc,
+                
"/root/page[1]/body/section[2]/txt[3]/SwParaPortion/SwLineLayout/child::*[2]",
+                "portion", "lah");
 
     // verify after hide
     dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});

Reply via email to