summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2023-10-16 19:39:30 +0200
committerLászló Németh <nemeth@numbertext.org>2023-10-17 10:37:23 +0200
commit7d08767b890e723cd502b1c61d250924f695eb98 (patch)
treeb018ee0e3142d8ce4a94b0c3150545290dceed49 /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parent7273de2730022deb37a8c7f2fedbe7fc4551f9b5 (diff)
tdf#130088 tdf#119908 smart justify: fix DOCX line count + compat opt.
Writer typeset DOCX files with more lines/pages, because of new default paragraph justification algorithm of MSO 2013 and newer, which resulted in losing text layout interoperability for new DOCX documents. Add new compatibility option "JustifyLinesWithShrinking" to store also the new type of justification in OpenDocument files. First analysis of the unknown justification algorithm shows up to 2% shrinking of plain justified line. Apply this value to break the lines in the same (or very similar) positions during importing a DOCX file with compatibilityMode >= 15 (created in MSO 2013 or newer), to avoid typesetting more lines and pages. Note: shrinking will be added by the next commits, fixing the temporary exceeding lines. Change-Id: I9a00db888e9af3f6723e4c502158e8e56a00ef02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158063 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1c4925b290d8..67fe56280c18 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -9075,6 +9075,11 @@ void DomainMapper_Impl::ApplySettingsTable()
if (m_pSettingsTable->GetDoNotExpandShiftReturn())
xSettings->setPropertyValue( "DoNotJustifyLinesWithManualBreak", uno::Any(true) );
+ // new paragraph justification has been introduced in version 15,
+ // breaking text layout interoperability: new line shrinking needs less space
+ // i.e. it typesets the same text with less lines and pages.
+ if (m_pSettingsTable->GetWordCompatibilityMode() >= 15)
+ xSettings->setPropertyValue("JustifyLinesWithShrinking", uno::Any( true ));
if (m_pSettingsTable->GetUsePrinterMetrics())
xSettings->setPropertyValue("PrinterIndependentLayout", uno::Any(document::PrinterIndependentLayout::DISABLED));
if( m_pSettingsTable->GetEmbedTrueTypeFonts())