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

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 27 20:31:17 UTC 2020


 sw/source/filter/ww8/docxattributeoutput.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 4ba179eb9208185406207522e39626327c7d74c3
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Thu Apr 23 09:39:58 2020 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Mon Apr 27 22:30:43 2020 +0200

    tdf#108496: DOCX: list overrides some cleanups
    
    This is a follow up commit to cf13fe3e fix with some
    mostly cosmetic changes. General idea of list overrides
    is not modified.
    
    Change-Id: I35937449bd563eacceb3753e62b9ff7245f12b89
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92739
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7c54e7e6010c..1648600dfdb8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6721,7 +6721,7 @@ static bool lcl_ListLevelsAreDifferentForExport(const SwNumFormat & rFormat1, co
             return true;
     }
 
-    // Compare numformats with emoty charformats
+    // Compare numformats with empty charformats
     SwNumFormat modified1 = rFormat1;
     SwNumFormat modified2 = rFormat2;
     modified1.SetCharFormatName(OUString());
@@ -6745,13 +6745,15 @@ void DocxAttributeOutput::OverrideNumberingDefinition(
     for (sal_uInt8 nLevel = 0; nLevel < nLevels; ++nLevel)
     {
         const auto levelOverride = rLevelOverrides.find(nLevel);
-        // only export it if it differs from abstract numbering definition
-        if ( lcl_ListLevelsAreDifferentForExport(rRule.Get(nLevel),rAbstractRule.Get(nLevel)) ||
-            levelOverride != rLevelOverrides.end() )
+        bool bListsAreDifferent = lcl_ListLevelsAreDifferentForExport(rRule.Get(nLevel), rAbstractRule.Get(nLevel));
+
+        // Export list override only if it is different to abstract one
+        // or we have a level numbering override
+        if (bListsAreDifferent || levelOverride != rLevelOverrides.end())
         {
             m_pSerializer->startElementNS(XML_w, XML_lvlOverride, FSNS(XML_w, XML_ilvl), OString::number(nLevel));
 
-            if (rRule.Get(nLevel) != rAbstractRule.Get(nLevel))
+            if (bListsAreDifferent)
             {
                 GetExport().NumberingLevel(rRule, nLevel);
             }


More information about the Libreoffice-commits mailing list