summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2021-05-19 13:58:35 +0300
committerAndras Timar <andras.timar@collabora.com>2021-05-27 08:26:45 +0200
commitf092c825e39a0bb0c2c30d3ea0b28f3743444e6f (patch)
tree8bd929c7f2d895cfbe17391661d284260b8b8db4 /writerfilter
parente537a98adf112e58b294e28905f40c29e6b69ec1 (diff)
tdf#132752: docx import: improvements for first line indent in lists
As far as I see, Word is using lists with id=0 and no list definitions to reset list numbering used in this paragraph. At the same time Word is still using some of default list properties. For example in this scenario parent style has defined first line indent, but in paragrath it is overwritten by "not existing" list=0 without definitions. To this moment I know about only first line indent behavior, but probably some other properties are also affected. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport16.cxx Change-Id: I344c907bb7a7b83a91f5727e13ad184fb44137b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115795 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116093 Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d3c779a10b6c..0d008bf78618 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1537,6 +1537,15 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
pParaContext->Insert(PROP_PARA_LEFT_MARGIN, uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false);
}
}
+
+ if (nListId == 0 && !pList)
+ {
+ // Seems situation with listid=0 and missing list definition is used by MS Word
+ // to remove numbering defined previously. But some default numbering attributes
+ // are still applied. This is first line indent, probably something more?
+ if (!pParaContext->isSet(PROP_PARA_FIRST_LINE_INDENT))
+ pParaContext->Insert(PROP_PARA_FIRST_LINE_INDENT, uno::makeAny(sal_Int16(0)), false);
+ }
}
// apply AutoSpacing: it has priority over all other margin settings
@@ -1996,7 +2005,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
const bool bLeftSet = pParaContext->isSet(PROP_PARA_LEFT_MARGIN);
const bool bRightSet = pParaContext->isSet(PROP_PARA_RIGHT_MARGIN);
const bool bFirstSet = pParaContext->isSet(PROP_PARA_FIRST_LINE_INDENT);
- if ( bLeftSet != bRightSet || bRightSet != bFirstSet )
+ if (bLeftSet != bRightSet || bRightSet != bFirstSet)
{
if ( !bLeftSet )
{