diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-02-27 17:21:16 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-02-27 19:24:46 +0100 |
commit | 5f58ffce789c15e3849bceb9fe4844d838e9c40e (patch) | |
tree | dbedd6993388bd947242dbd53cdac1fd6376b833 /sw/source/core/doc/notxtfrm.cxx | |
parent | 59ace23c367f83491a37e844d16f7d716eff6346 (diff) |
tdf#130951 Use the correct OutputDevice
In SwViewShell mode maybe isOutputToWindow,
in that cases use GetWin() instead of GetOut()
Change-Id: I181ac436000325f3aa93cd508e468d500a682131
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89644
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sw/source/core/doc/notxtfrm.cxx')
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 12f6e6045b3d..53d878c684ec 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -1309,13 +1309,25 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr // repaint to VOC and Primitives, too. static const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES")); static bool bUseViewObjectContactMechanism(nullptr == pDisableMM02Goodies); + // tdf#130951 for safety reasons use fallback if ViewObjectContactMechanism + // fails for some reason - usually could only be not to find the correct + // SdrPageWindow + bool bSucceeded(false); if(bUseViewObjectContactMechanism) { // MM02 use VOC-mechanism and buffer primitives SwViewShellImp* pImp(pShell->Imp()); - SdrPageView* pPageView(nullptr != pImp ? pImp->GetPageView() : nullptr); - SdrPageWindow* pPageWindow(nullptr != pPageView ? pPageView->FindPageWindow(*pShell->GetOut()) : nullptr); + SdrPageView* pPageView(nullptr != pImp + ? pImp->GetPageView() + : nullptr); + // tdf#130951 caution - target may be Window, use the correct OutputDevice + OutputDevice* pTarget(pShell->isOutputToWindow() + ? pShell->GetWin() + : pShell->GetOut()); + SdrPageWindow* pPageWindow(nullptr != pPageView && nullptr != pTarget + ? pPageView->FindPageWindow(*pTarget) + : nullptr); if(nullptr != pPageWindow) { @@ -1334,9 +1346,11 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr nullptr == pGrfNd->GetFlyFormat() ? OUString() : pGrfNd->GetFlyFormat()->GetName(), rNoTNd.GetTitle(), rNoTNd.GetDescription()); + bSucceeded = true; } } - else + + if(!bSucceeded) { // MM02 fallback to direct paint with primitive-recreation // which will block reusage of system-dependent bitmap data |