diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-31 15:05:48 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-31 17:49:00 +0000 |
commit | 50223ea6e212b60b7d33839c2753c5601fb50f95 (patch) | |
tree | c86be1491f5b6d52c44a06714c005997a6858bc2 /sw/source/uibase/uno/SwXDocumentSettings.cxx | |
parent | a88837470d7a01e63c28ac3930c1f10d84dc218d (diff) |
tdf#98987 sw: add AddVerticalFrameOffsets compat mode
The situation is the following: we have a text frame, with at least two
anchored objects: one is wrapped not-wrap-through, the other is. In case
the non-wrap-though one shifts the text content of the text frame right or
down, then layout may or may not want to re-consider what is the top
left corner of the text frame for anchoring purposes.
Regarding the x position, sw layout repositioned the anchor point
depending on the AddFrameOffsets compat mode: it's enabled for documents
imported from Word, disabled otherwise. Regarding the y position, no
repositioning was done, however the bugdoc shows that Word does the same
repositioning on the vertical axis as well.
Add a new AddVerticalFrameOffsets compat mode that enables vertical
repositioning as well, and enable that mode for documents imported from
DOCX.
Change-Id: Idc5cad7d86662008a92ff3bf5fbb3806aa2c7b07
Reviewed-on: https://gerrit.libreoffice.org/23702
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/uibase/uno/SwXDocumentSettings.cxx')
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 09bdde21294e..0ef134d0a09b 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -86,6 +86,7 @@ enum SwDocumentSettingsPropertyHandles HANDLE_PRINTER_INDEPENDENT_LAYOUT, HANDLE_IS_LABEL_DOC, HANDLE_IS_ADD_FLY_OFFSET, + HANDLE_IS_ADD_VERTICAL_FLY_OFFSET, HANDLE_IS_ADD_EXTERNAL_LEADING, HANDLE_OLD_NUMBERING, HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, @@ -159,6 +160,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo() { OUString("PrinterIndependentLayout"), HANDLE_PRINTER_INDEPENDENT_LAYOUT, cppu::UnoType<sal_Int16>::get(), 0}, { OUString("IsLabelDocument"), HANDLE_IS_LABEL_DOC, cppu::UnoType<bool>::get(), 0}, { OUString("AddFrameOffsets"), HANDLE_IS_ADD_FLY_OFFSET, cppu::UnoType<bool>::get(), 0}, + { OUString("AddVerticalFrameOffsets"), HANDLE_IS_ADD_VERTICAL_FLY_OFFSET, cppu::UnoType<bool>::get(), 0}, { OUString("AddExternalLeading"), HANDLE_IS_ADD_EXTERNAL_LEADING, cppu::UnoType<bool>::get(), 0}, { OUString("UseOldNumbering"), HANDLE_OLD_NUMBERING, cppu::UnoType<bool>::get(), 0}, { OUString("OutlineLevelYieldsNumbering"), HANDLE_OUTLINELEVEL_YIELDS_NUMBERING, cppu::UnoType<bool>::get(), 0}, @@ -552,6 +554,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_FLY_OFFSETS, bTmp); } break; + case HANDLE_IS_ADD_VERTICAL_FLY_OFFSET: + { + bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue()); + mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS, bTmp); + } + break; case HANDLE_IS_ADD_EXTERNAL_LEADING: { bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue()); @@ -1020,6 +1028,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_FLY_OFFSETS); } break; + case HANDLE_IS_ADD_VERTICAL_FLY_OFFSET: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS); + } + break; case HANDLE_IS_ADD_EXTERNAL_LEADING: { rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_EXT_LEADING); |