summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-23 18:05:26 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-23 22:22:56 +0100
commit195eae4852012eed6da72c0a9f55094a09aa2867 (patch)
treea843ed390fe1dc4994c405126226ccd8f49a1696 /sw/source/core/objectpositioning
parent2a0aba855b09b45297091098bfa9e1d1bcdb055c (diff)
sw DoNotCaptureDrawObjsOnPage: don't capture wrap-through Writer images, either
This compat flag was originally added in commit 7961b14c4f9f00696b241e5ad9bf9ba18041fe22 (INTEGRATION: CWS swdrawobjpos203 (1.12.54); FILE MERGED, 2006-03-22) for compatibility with OOo 1.x. Later commit af313fc149f80adb0f1680ca20e19745ccb7fede (tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option, 2017-01-06) also turned it on for DOCX documents. One overlooked difference was that the compat flag disables "capturing" of draw objects only, but not wrap-through Writer images. The DOCX case wants the same for wrap-through Writer images as well, since Word does no capturing in either case. Fix the problem by disabling capturing for wrap-through Writer images as well; if this turns out to be too problematic, we can have a dedicated compat flag just for OOo 1.x documents, but that comes at some cost as well. (Need to write the new compat flag to each & every new ODT.) TextBoxes are handled separately (see testTDF91260 in CppunitTest_sw_ooxmlexport8), so leave their handling unchanged. Change-Id: I74f434ed7518d7784c7cba085deb6ff8baf1770a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87289 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/objectpositioning')
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 6a9e02a499bf..48a0e27c881c 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -117,10 +117,12 @@ void SwAnchoredObjectPosition::GetInfoAboutObj()
// determine, if anchored object has not to be captured on the page.
// the following conditions must be hold to *not* capture it:
// - corresponding document compatibility flag is set
- // - it's a drawing object
+ // - it's a drawing object or it's a non-textbox wrap-though fly frame
// - it doesn't follow the text flow
{
- mbDoNotCaptureAnchoredObj = !mbIsObjFly && !mbFollowTextFlow &&
+ bool bTextBox = SwTextBoxHelper::isTextBox(mpFrameFormat, RES_FLYFRMFMT);
+ bool bWrapThrough = mpFrameFormat->GetSurround().GetSurround() == css::text::WrapTextMode_THROUGH;
+ mbDoNotCaptureAnchoredObj = (!mbIsObjFly || (!bTextBox && bWrapThrough)) && !mbFollowTextFlow &&
mpFrameFormat->getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE);
}
}