[Libreoffice-commits] core.git: writerfilter/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 8 07:00:52 UTC 2021


 writerfilter/source/dmapper/NumberingManager.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e5b3f975144228d49c0bac71031fc7356fd252ab
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Wed Jul 7 06:59:33 2021 +0200
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Thu Jul 8 09:00:19 2021 +0200

    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 at sil.org>

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();


More information about the Libreoffice-commits mailing list