summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-06-18 13:20:49 +0200
committerJustin Luth <justin_luth@sil.org>2021-06-22 17:59:49 +0200
commitce20614b630e50fbfcc82e4cd2f565b04dfb788e (patch)
treee7ebb5c99c1ab93b48b7a58480865bf74002d47b /sw
parentf2ea39c70da3f82bb39f8b51b5484172360b1fc2 (diff)
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@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx6
2 files changed, 8 insertions, 2 deletions
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())
{