sw/qa/extras/ooxmlexport/data/tdf146851_2.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx     |   19 +++++++++++++++++++
 sw/source/core/txtnode/ndtxt.cxx               |    3 +--
 sw/source/filter/ww8/wrtw8num.cxx              |    3 +--
 4 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit c13c94b0ff103484e00403b034eef73ba1ea17c5
Author:     Vasily Melenchuk <vasily.melenc...@cib.de>
AuthorDate: Sat Mar 12 09:07:53 2022 +0300
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Thu Mar 17 12:24:15 2022 +0100

    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.behr...@allotropia.de>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131648

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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf146851_2.docx 
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();

Reply via email to