summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/NumberingManager.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-07-07 06:59:33 +0200
committerJustin Luth <justin_luth@sil.org>2021-07-08 09:00:19 +0200
commite5b3f975144228d49c0bac71031fc7356fd252ab (patch)
tree2f51a46a1f32b7fbb6a7048d0ea9e87ca9bd39bc /writerfilter/source/dmapper/NumberingManager.cxx
parent8f962ddc45ca4f6825b41f2786f9fd219b4c1586 (diff)
tdf#141966 writerfilter CN: set minimum threshold
I have found that in both DOC and DOCX numbering bugs, many can be fixed simply by not assigning Chapter Numbering at all. So set a minimum threshold to deter useless assignments. [Note that a LO round-trip should save as numId 1, and thus a single entry would make it qualify. For Word-authored documents, this threshold means at least 3 Heading X styles (which matches LO default workflow) or 6 out of 9 Levels defined for non-heading styles.] Change-Id: Ic3d1c800a703721e7ab5302e274ee1eeda496ac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118543 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter/source/dmapper/NumberingManager.cxx')
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 98c634511124..62118630e2d4 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -1181,8 +1181,9 @@ ListDef::Pointer ListsManager::GetList( sal_Int32 nId )
void ListsManager::CreateNumberingRules( )
{
// Try to determine which numId would best work as LO's Chapter Numbering Outline rule.
+ // (The best fix for many import bugs is just to prevent ANY assignment as chapter numbering.)
sal_Int16 nChosenAsChapterNumberingId = -1;
- sal_uInt16 nHighestWeight = 0;
+ sal_uInt16 nHighestWeight = 5; // arbitrarily chosen minimum threshold
for (const auto& rList : m_aLists)
{
sal_uInt16 nWeight = rList->GetChapterNumberingWeight();