diff options
Diffstat (limited to 'svx/source/svdraw/svdmrkv.cxx')
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index a7f5ba78c4a3..eef111ce4103 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -242,7 +242,8 @@ void SdrMarkView::ModelHasChanged() sal_uInt32 nTotalPaintWindows = this->PaintWindowCount(); if (nTotalPaintWindows == 1) { - const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice()); + const OutputDevice* pOut = this->GetFirstOutputDevice(); + const vcl::Window* pWin = pOut ? pOut->GetOwnerWindow() : nullptr; if (pWin && pWin->IsChart()) { const vcl::Window* pViewShellWindow = GetSfxViewShell()->GetEditWindowForActiveOLEObj(); @@ -758,7 +759,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S sal_uInt32 nTotalPaintWindows = this->PaintWindowCount(); if (nTotalPaintWindows == 1) { - const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice()); + const OutputDevice* pOut = this->GetFirstOutputDevice(); + const vcl::Window* pWin = pOut ? pOut->GetOwnerWindow() : nullptr; if (pWin && pWin->IsChart()) { bIsChart = true; @@ -930,7 +932,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S const basegfx::B2DPolygon aPolygon = aPolyPolygon.getB2DPolygon(0); if (sal_uInt32 nPolySize = aPolygon.count()) { - const vcl::Window* pWin = dynamic_cast<const vcl::Window*>(this->GetFirstOutputDevice()); + const OutputDevice* pOut = this->GetFirstOutputDevice(); + const vcl::Window* pWin = pOut ? pOut->GetOwnerWindow() : nullptr; const vcl::Window* pViewShellWindow = pViewShell->GetEditWindowForActiveOLEObj(); if (pWin && pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin)) { |