summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2021-05-19 13:58:35 +0300
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-05-25 11:42:14 +0200
commita4e7df83fcac6c68f110f89f41d5eb623038410e (patch)
tree6b0e748a6cafc0ce154e1995aa23e19bdf9928b1 /writerfilter
parent4632f935951584826d18f04939cf6c809fd370cc (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. Change-Id: I344c907bb7a7b83a91f5727e13ad184fb44137b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115795 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
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 863526d814fd..fb1408042a16 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1551,6 +1551,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
@@ -2041,7 +2050,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 )
{