summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/unocontrol.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/source/controls/unocontrol.cxx')
-rw-r--r--toolkit/source/controls/unocontrol.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index a97cb2229942..e669e7e9889e 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -183,7 +183,9 @@ Reference< XWindowPeer > UnoControl::ImplGetCompatiblePeer()
vcl::Window* pParentWindow( nullptr );
{
SolarMutexGuard aGuard;
- pParentWindow = dynamic_cast< vcl::Window* >( Application::GetDefaultDevice() );
+ auto pDefaultDevice = Application::GetDefaultDevice();
+ if (pDefaultDevice)
+ pParentWindow = pDefaultDevice->GetOwnerWindow();
ENSURE_OR_THROW( pParentWindow != nullptr, "could obtain a default parent window!" );
}
try