diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2020-06-11 09:45:03 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-08-13 11:13:49 +0200 |
commit | ed79b0f274c913ce8206a68a2ca9296b84ac0751 (patch) | |
tree | bcc945d05200362e1f766ef7c5c3a56d86290d08 /writerfilter | |
parent | f27fd86d2dc424cee2d28fe77d881eacc4795eaf (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()) { |