diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2020-06-11 09:45:03 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-08-17 10:18:44 +0200 |
commit | 07370d6efc986a5060a75cc9972742202a0b73c3 (patch) | |
tree | b2c0b0e268d9621f2903a9705a00a35e0b35078a /writerfilter | |
parent | f8c1d40c9fdffc00ad02e4f43686fb4140d753ef (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100542
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 58399cf0a151..90fb9c98752d 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -23,6 +23,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> @@ -701,6 +702,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()) { |