summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2021-12-26 20:38:30 +0300
committerVasily Melenchuk <vasily.melenchuk@cib.de>2021-12-27 15:47:21 +0100
commitbf2b46aa15665dde63ceff4e7686b99b3990354f (patch)
tree765ac9ce801e742d2d6f4dd56640e4a5bd53a48f /sw/qa/extras
parentbbfce0b49fb11997af8eb03d40431b6a78f2aebe (diff)
tdf#146257: sw: better handling for list numbering = NONE
Previously during refactoring were lost some corner cases with some level having disabled numbering. In this case LO should strip useless delimiters up to next level. For example, if second level has disabled numbering, third level should look like "1.1", but not "1..1". Change-Id: I259a16b456f51bc76d5c8360974d0acadfc36776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127517 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/odfimport/data/tdf146257.odtbin0 -> 12148 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx32
2 files changed, 32 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf146257.odt b/sw/qa/extras/odfimport/data/tdf146257.odt
new file mode 100644
index 000000000000..2431fc0a8ff0
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf146257.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 9d020031fb7d..fa79c7197f42 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1296,5 +1296,37 @@ CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexSecondPage)
sal_Int32(3), getProperty<sal_Int32>(getShapeByName(u"Shape2"), "ZOrder"));
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf146257)
+{
+ load(mpTestDocumentPath, "tdf146257.odt");
+
+ // First list should contain no labels
+ {
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+ }
+ {
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+ }
+ {
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(4), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+ }
+ // For second list ensure second level empty and thord level should not contain extra dots
+ {
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(6), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString"));
+ }
+ {
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(7), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+ }
+ {
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString"));
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */