diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2022-03-12 09:07:53 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-03-16 04:43:27 +0100 |
commit | bcede3c0ed94d413fea18d2457b916a9f5f4346a (patch) | |
tree | 9d99bd6633fed908f6aecb1a7e20e8e82ba73662 | |
parent | f50a8f1d8852bfc143809dc5d45ef662d3557a61 (diff) |
tdf#146851: sw: even numbering=None is still a numbering
Text node containing a numbering rule with numbering format
with SVX_NUM_NUMBER_NONE is still a numbering: it will display
prefix, suffix and other numbering properties.
Change-Id: I52077824b4a1db2e9220701fdd514670490a59db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131410
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf146851_2.docx | bin | 0 -> 14171 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 19 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 3 |
4 files changed, 21 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf146851_2.docx b/sw/qa/extras/ooxmlexport/data/tdf146851_2.docx Binary files differnew file mode 100644 index 000000000000..fbd5f40a687e --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf146851_2.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index c6a795c0ab01..a33da51048b8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -281,6 +281,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146851_1, "tdf146851_1.docx") CPPUNIT_ASSERT_EQUAL(OUString("1/"), getProperty<OUString>(xPara, "ListLabelString")); } +DECLARE_OOXMLEXPORT_TEST(testTdf146851_2, "tdf146851_2.docx") +{ + // Ensure numbering on second para + uno::Reference<beans::XPropertySet> xPara; + xPara.set(getParagraph(2, "."), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Schedule"), getProperty<OUString>(xPara, "ListLabelString")); + + // Refresh fields and ensure cross-reference to numbered para is okay + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + + uno::Reference<util::XRefreshable>(xFieldsAccess, uno::UNO_QUERY_THROW)->refresh(); + + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + uno::Reference<text::XTextField> xTextField(xFields->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Schedule"), xTextField->getPresentation(false)); +} + DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") { xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 552505e573f4..8a134276c562 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3074,8 +3074,7 @@ bool SwTextNode::HasNumber(SwRootFrame const*const pLayout) const const SwNumFormat& aFormat(pRule->Get(lcl_BoundListLevel(GetActualListLevel()))); // #i40041# - bResult = aFormat.IsEnumeration() && - SVX_NUM_NUMBER_NONE != aFormat.GetNumberingType(); + bResult = aFormat.IsEnumeration(); } return bResult; diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 4836678172e9..e61ca56b5a8b 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -473,8 +473,7 @@ void MSWordExportBase::NumberingLevel( else { // Create level string - if (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType() && - rFormat.HasListFormat()) + if (rFormat.HasListFormat()) { sal_uInt8* pLvlPos = aNumLvlPos; sNumStr = rFormat.GetListFormat(); |