diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2020-06-11 09:45:03 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-06-24 13:10:27 +0200 |
commit | ee7b6c773eb22268fefee4bfcc10110b0bbbd8cf (patch) | |
tree | 21cf71c5762ff0d8b477eb3ae5be633824ec7900 /writerfilter | |
parent | d0cf50c553ea738de1a35fcc4feec4021ab7ebe0 (diff) |
tdf#128197: sw: different line height for DOCX with compat=14
Lines containing just a shape inline without any other text are
treated in DOCX with compatibility option 15 and 14 in a different
way: while compat=15 is layouting line exatly as LO does, in
compat=14 mode minimal line height takes into account just shape
height and not current font.
Change-Id: Id2bdab941a0bbaa9080567d736435d9e0babd490
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96080
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/SettingsTable.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 93bc03b60f75..e7af3f19e911 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -24,6 +24,7 @@ #include <rtl/ustring.hxx> #include <sfx2/zoomitem.hxx> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -731,6 +732,13 @@ void SettingsTable::ApplyProperties(uno::Reference<text::XTextDocument> const& x { uno::Reference< beans::XPropertySet> xDocProps( xDoc, uno::UNO_QUERY ); + if (GetWordCompatibilityMode() <= 14) + { + uno::Reference<lang::XMultiServiceFactory> xTextFactory(xDoc, uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xDocumentSettings(xTextFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY_THROW); + xDocumentSettings->setPropertyValue("MsWordCompMinLineHeightByFly", uno::makeAny(true)); + } + // Show changes value if (xDocProps.is()) { |