diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2021-04-22 13:26:58 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-05-05 10:58:03 +0200 |
commit | 4e7ef3f7421febc08e621bf9ca276cec7b032808 (patch) | |
tree | dba0793040ad5dc9296d1eb94a74e3b593de865a /writerfilter | |
parent | 181b5538f6bdbd1d5d2f906a1ad4bc8d0a70a043 (diff) |
tdf#138782 DOCX import: fix frame positions of old docs
by limiting AddFrameOffsets compatibility option
for docs created by MSO 2010 or older.
Likely regression from commit 355d25eac764713f4d52eac801ade6e2ff1deab0
(n#779627: added quite some compat options from the ww8
filter on writerfilter).
This patch fixes several bugs, which were
collected as duplicates by Gábor Kelemen.
Change-Id: I106e90c4bf00bb0b6a8986615cb3ad9c4828d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114476
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 5812fb81013cc124a9b6a0b9912a34cc715fc495)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115077
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/filter/WriterFilter.cxx | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 4a1481f3ea44..b2765a8c572c 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -249,6 +249,11 @@ DomainMapper::~DomainMapper() aGrabBag.update(aProperties); xDocProps->setPropertyValue("InteropGrabBag", uno::Any(aGrabBag.getAsConstPropertyValueList())); } + + // tdf#138782: for docs created in MS Word 2010 and older (compatibilityMode <= 14) + m_pImpl->SetDocumentSettingsProperty( + "AddFrameOffsets", + uno::Any(14 >= m_pImpl->GetSettingsTable()->GetWordCompatibilityMode())); } catch( const uno::Exception& ) {} diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 0f0fcdb63391..d866981dd438 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -304,7 +304,6 @@ void WriterFilter::setTargetDocument(const uno::Reference<lang::XComponent>& xDo uno::Reference<beans::XPropertySet> xSettings( xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); - xSettings->setPropertyValue("AddFrameOffsets", uno::makeAny(true)); xSettings->setPropertyValue("AddVerticalFrameOffsets", uno::makeAny(true)); xSettings->setPropertyValue("UseOldNumbering", uno::makeAny(false)); xSettings->setPropertyValue("IgnoreFirstLineIndentInNumbering", uno::makeAny(false)); |