summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2022-03-12 09:07:53 +0300
committerAndras Timar <andras.timar@collabora.com>2022-03-22 10:30:10 +0100
commitf5eaa816bb7b05a2ae4befccd4b770cfb3bc50bb (patch)
tree15c5b9798230d9ca9b5cd53866d848f679485e2e /sw
parent8cdce6fa83802c83474a29443b285feee4838ab6 (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> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131648
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf146851_2.docxbin0 -> 14171 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx19
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx3
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx3
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
new file mode 100644
index 000000000000..fbd5f40a687e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf146851_2.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index d8e15116eb48..9937d86b0f88 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -162,6 +162,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 4d576f479e5c..4d109a8add1c 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3073,8 +3073,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();