From 8d62b79f168180c6992eb483ec864d473050635f Mon Sep 17 00:00:00 2001 From: Patrick Jaap Date: Wed, 29 Nov 2017 12:41:33 +0100 Subject: tdf#112443 disable off-page content positioning Disable the positioning for objects that are completely off-page. During import, LO writer forces content always back to the page and causes unwanted content on the page in constrast to MSO. To achive this the top/left position of the content is compared to the bottom/right border of the clipping region. A new compatibility flag OFF_PAGE_POSITIONING is introduced for legacy rendering of legacy documents. A unit test demonstrates the issue. It resolves tdf#112443. Change-Id: I263c129f9f09ed909ad777a34f8b9ffc84d871e4 Reviewed-on: https://gerrit.libreoffice.org/43313 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sw/source/uibase/uno/SwXDocumentSettings.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sw/source/uibase/uno') diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index ed0b315a02b7..ee86063fea52 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -134,6 +134,7 @@ enum SwDocumentSettingsPropertyHandles HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, HANDLE_SUBTRACT_FLYS, + HANDLE_DISABLE_OFF_PAGE_POSITIONING, }; static MasterPropertySetInfo * lcl_createSettingsInfo() @@ -210,6 +211,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo() { OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType::get(), 0}, { OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType::get(), 0}, { OUString("SubtractFlysAnchoredAtFlys"), HANDLE_SUBTRACT_FLYS, cppu::UnoType::get(), 0}, + { OUString("DisableOffPagePositioning"), HANDLE_DISABLE_OFF_PAGE_POSITIONING, cppu::UnoType::get(), 0}, /* * As OS said, we don't have a view when we need to set this, so I have to * find another solution before adding them to this property set - MTG @@ -855,6 +857,16 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf } } break; + case HANDLE_DISABLE_OFF_PAGE_POSITIONING: + { + bool bTmp; + if (rValue >>= bTmp) + { + mpDoc->getIDocumentSettingAccess().set( + DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING, bTmp); + } + } + break; default: throw UnknownPropertyException(); } @@ -1269,6 +1281,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::SUBTRACT_FLYS); } break; + case HANDLE_DISABLE_OFF_PAGE_POSITIONING: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING); + } + break; default: throw UnknownPropertyException(); } -- cgit