summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2020-04-23 09:39:58 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-04-27 22:30:43 +0200
commit4ba179eb9208185406207522e39626327c7d74c3 (patch)
tree1c0c507364e66ed4eec7611fc38232f3b2da946d /sw
parent4559ca1a9a276ed581e1799b3aa90fb084a3eb3f (diff)
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@CIB.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
1 files changed, 7 insertions, 5 deletions
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);
}