summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2024-10-29 12:11:41 +0100
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2024-11-05 07:44:30 +0100
commit2a2c4dddf51c0d6ab726a8854123887bbfa7792a (patch)
tree32d56c1640f462c934f2c7591cee4eee33746fca /sw/qa/extras/uiwriter
parent5de26fbf37f02a9c5a0ae96140ec50167709eaf2 (diff)
tdf#153636 - Search for outline node only if index is for the current chapter
Otherwise, "Use level from source chapter" does not work for Graphics and Frames in user-defined indices. Change-Id: I148a097276cf8a60d69a208266ceb9def0444654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175783 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf153636.odtbin0 -> 62520 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter8.cxx29
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf153636.odt b/sw/qa/extras/uiwriter/data/tdf153636.odt
new file mode 100644
index 000000000000..d2380120d39e
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf153636.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx
index de35df5d570e..1c09ab6a9ad6 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2896,6 +2896,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
"portion", u"another sub three");
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf153636)
+{
+ createSwDoc("tdf153636.odt");
+ dispatchCommand(mxComponent, u".uno:UpdateAllIndexes"_ustr, {});
+ saveAndReload(u"writer8"_ustr);
+
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ for (int i = 1; i <= 3; i += 2)
+ {
+ const OUString frameStyleName
+ = getXPath(pXmlDoc,
+ "/office:document-content/office:body/office:text/"
+ "text:user-index[@text:name='User-Defined1']/text:index-body/text:p["
+ + OString::number(i) + "]",
+ "style-name");
+ const OUString tableStyleName
+ = getXPath(pXmlDoc,
+ "/office:document-content/office:body/office:text/"
+ "text:user-index[@text:name='User-Defined1']/text:index-body/text:p["
+ + OString::number(i + 1) + "]",
+ "style-name");
+
+ // Without the fix in place, the frame and table indentation would differ
+ CPPUNIT_ASSERT_EQUAL(frameStyleName, tableStyleName);
+ }
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf157129)
{
// Unit test for tdf#157129