[Libreoffice-commits] core.git: sw/qa sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 22 16:00:30 UTC 2021


 sw/qa/extras/ww8export/ww8export3.cxx |    4 ++--
 sw/source/filter/ww8/ww8par3.cxx      |    6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit ce20614b630e50fbfcc82e4cd2f565b04dfb788e
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Jun 18 13:20:49 2021 +0200
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Tue Jun 22 17:59:49 2021 +0200

    tdf#106541 doc import: prevent inheriting when LFO == 0
    
    When LFO == 0, that is a special case that means that
    numbering should be disabled. (This can similarly be
    accomplished by setting Lvl to 9 - Body text,
    except doing so here could mess up Lvl inheritance).
    
    If the LFO is a negative number, that indicates something
    different with formatting that we don't currently handle,
    but it still means cancel numbering. So at this point
    just treat them all the same as if they were LFO 0.
    
    Change-Id: I1bab06c6b766175a3982bf3a7b19f7b321df807e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117480
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index d8d6d4ef3d7f..44287442c788 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -783,9 +783,9 @@ DECLARE_WW8EXPORT_TEST(testTdf106541_cancelOutline, "tdf106541_cancelOutline.doc
 {
     // The ability to cancel numbering must not be lost.
     uno::Reference<beans::XPropertySet> xPara(getParagraph(1, "Cancelled by style"), uno::UNO_QUERY);
-    //TEMPORARY CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+    CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
     xPara.set(getParagraph(2, "Cancelled by inherited style"), uno::UNO_QUERY);
-    //TEMPORARY CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+    CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
     xPara.set(getParagraph(4, "Cancelled by direct paragraph formatting"), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
 }
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 7060c85d9d33..5f36371e5b03 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1936,6 +1936,12 @@ void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
 
                 // reset/blank the indent
                 m_pCurrentColl->SetFormatAttr(SvxLRSpaceItem(RES_LR_SPACE));
+
+                // These sprmPIlfos are supposed to indicate "cancel" numbering.
+                // Since m_nLFOPosition is "data - 1", then zero becomes USHRT_MAX
+                // which is no good since that indicates "unspecified, available for inheritance".
+                // So instead use USHRT_MAX-1 for indicating an explicit "cancel numbering".
+                RegisterNumFormat(USHRT_MAX-1, MAXLEVEL);
             }
             else if (SwTextNode* pTextNode = m_pPaM->GetNode().GetTextNode())
             {


More information about the Libreoffice-commits mailing list