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

New commits:
commit 483afea3a99b928d0e1cb1df0415a06269067559
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Thu Oct 27 08:46:46 2022 +0200
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Thu Oct 27 12:20:29 2022 +0200

    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>

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/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 5c1476e30685..a0d40ff5cca6 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2375,6 +2375,43 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf97899)
     CPPUNIT_ASSERT(!sCharStyleName.isEmpty());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, 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