sw/qa/extras/uiwriter/data/tdf151462.odt |binary
 sw/qa/extras/uiwriter/uiwriter6.cxx      |   35 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

New commits:
commit fab66b3f912462527adfb06870cd52d087485c74
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Thu Oct 27 08:46:46 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Nov 2 10:20:53 2022 +0100

    tdf#151462 - Search for outline node containing the current node
    
    Added unit test
    
    Change-Id: I9fcc26527ec2f7e036ee32a709f023fcc50d9e6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141892
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142157

diff --git a/sw/qa/extras/uiwriter/data/tdf151462.odt 
b/sw/qa/extras/uiwriter/data/tdf151462.odt
new file mode 100755
index 000000000000..cdd250232e18
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf151462.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index b47da8fb386b..fb3b53c179b8 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -2171,6 +2171,41 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCaptionShape)
     CPPUNIT_ASSERT_EQUAL(1, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf151462)
+{
+    createSwDoc(DATA_DIRECTORY, "tdf151462.odt");
+    //   xmlDocUniquePtr pLayout = parseLayoutDump();
+    dispatchCommand(mxComponent, ".uno:UpdateAllIndexes", {});
+    Scheduler::ProcessEventsToIdle();
+    xmlDocUniquePtr pLayout = parseLayoutDump();
+    // tdf#151462 - without the fix in place, there would be just the first 
index entry
+    assertXPath(pLayout,
+                
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[1]/SwParaPortion/"
+                "SwLineLayout[1]/SwLinePortion[1]",
+                "portion", "sub one");
+    assertXPath(pLayout,
+                
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[2]/SwParaPortion/"
+                "SwLineLayout[1]/SwLinePortion[1]",
+                "portion", "sub two");
+    assertXPath(pLayout,
+                
"/root/page[1]/body/txt[2]/anchored/fly/section/txt[3]/SwParaPortion/"
+                "SwLineLayout[1]/SwLinePortion[1]",
+                "portion", "sub three");
+    // tdf#151462 - without the fix in place, there would be just the first 
index entry
+    assertXPath(pLayout,
+                
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[1]/SwParaPortion/"
+                "SwLineLayout[1]/SwLinePortion[1]",
+                "portion", "another sub one");
+    assertXPath(pLayout,
+                
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[2]/SwParaPortion/"
+                "SwLineLayout[1]/SwLinePortion[1]",
+                "portion", "another sub two");
+    assertXPath(pLayout,
+                
"/root/page[1]/body/txt[6]/anchored/fly/section/txt[3]/SwParaPortion/"
+                "SwLineLayout[1]/SwLinePortion[1]",
+                "portion", "another sub three");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to