summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-02-10 19:20:03 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-02-12 00:22:13 +0100
commitc2a5346b19c57f93f210b76c15cdba64f6871203 (patch)
treef7de2b18dde846027b0dd23c572d63ca4e25dfff /writerfilter
parent58d2d3480018986835384ac12307131a6d30997f (diff)
related: tdf#106742 sw: DOCX import/export: fix default of table indent
There's a compatibilityMode in word/settings.xml in DOCX files: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/90138c4d-eb18-4edc-aa6c-dfb799cb1d0d If a document doesn't contain compatibilityMode, then the default is 12, but the code for table indent import/export assumed that the default is 15, so loading an ODF document and exporting as DOCX results in wrong table indent when loaded in Word. (regression from 9a31d1c83e08600507689dc18f6f0973bc7e4389) Change-Id: I3ce32286473640e5b7e12b487aef5f123bfb8d12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88408 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit d978f5d40102a098f1faf1e98aa39ad122284299) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88392 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 820408638a8d..83cf9277b3e9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -583,10 +583,10 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
lcl_adjustBorderDistance(rInfo, aLeftBorder, aRightBorder);
// tdf#106742: since MS Word 2013 (compatibilityMode >= 15), top-level tables are handled the same as nested tables;
- // this is also the default behavior in LO when DOCX doesn't define "compatibilityMode" option
+ // the default behavior when DOCX doesn't define "compatibilityMode" option is to add the cell spacing
sal_Int32 nMode = m_rDMapper_Impl.GetSettingsTable()->GetWordCompatibilityMode();
- if ( nMode > 0 && nMode <= 14 && rInfo.nNestLevel == 1 )
+ if (((nMode < 0) || (0 < nMode && nMode <= 14)) && rInfo.nNestLevel == 1)
{
m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::makeAny( nLeftMargin - nGapHalf - rInfo.nLeftBorderDistance ) );
}