diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-08-04 18:56:08 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-08-07 00:41:38 +0200 |
commit | 56e1c88a7b2fc31682a239f59ec319f93ba61a25 (patch) | |
tree | 9ff1c0e4618bf8919f5c1ca5c83d8bb8de20bbf6 /sw/inc | |
parent | 0de435962fc2ffbbcf3dc4a9bac13894372dfd5e (diff) |
tdf#135464 sw: ODT->DOCX: fix positioning of at-page shapes and frames
Exporting at-page anchored flys to DOCX can result in wrong positions,
because DocxSdrExport::startDMLAnchorInline() converts
text::RelOrientation::FRAME to relativeFrom="column", i.e. the margin,
but sw displays it as relative to the page.
In fact at-page and FRAME is an invalid combination according to the
table in ODF 1.3, 20.298 style:horizontal-pos, the paragraph and
character relations are not valid for page-anchored flys.
Since there are lots of ODT files with this invalid combination, try to
fix it on import, in SwXFrame and SwXShape.
Funnily, SwXShape is attached before the properties are set, while
SwXFrame is attached after the properties are set.
The anchor frame for at-page is always a SwPageFrame.
Unfortunately there is a case where PRINT_AREA and PAGE_PRINT_AREA
differ, namely the CalcClipRect() only handles PRINT_AREA so it will
crop to the right margin with that but not with PAGE_PRINT_AREA,
so don't map this value.
Change-Id: I4d5f7f87d045ac4539b9170e55c34d4afe801f4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100130
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit 12645900dece0a9aa0661fee796c27f672217977)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100237
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/fmtornt.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx index 0a8ab6f1a619..59afdb46f26a 100644 --- a/sw/inc/fmtornt.hxx +++ b/sw/inc/fmtornt.hxx @@ -108,6 +108,12 @@ inline const SwFormatVertOrient &SwFormat::GetVertOrient(bool bInP) const inline const SwFormatHoriOrient &SwFormat::GetHoriOrient(bool bInP) const { return m_aSet.GetHoriOrient(bInP); } +namespace sw { + + bool GetAtPageRelOrientation(sal_Int16 & rOrientation, bool const isIgnorePrintArea); + +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |