diff options
Diffstat (limited to 'include/toolkit/awt/vclxwindow.hxx')
-rw-r--r-- | include/toolkit/awt/vclxwindow.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx index 5e5ac617a26a..24cefd4e5a6a 100644 --- a/include/toolkit/awt/vclxwindow.hxx +++ b/include/toolkit/awt/vclxwindow.hxx @@ -123,10 +123,14 @@ public: virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ); template< class derived_type > derived_type* GetAs() const { - return static_cast< derived_type * >( GetOutputDevice().get() ); } + return static_cast< derived_type * >( GetWindow() ); } template< class derived_type > derived_type* GetAsDynamic() const { - return dynamic_cast< derived_type * >( GetOutputDevice().get() ); } - vcl::Window* GetWindow() const { return GetAs<vcl::Window>(); } + return dynamic_cast< derived_type * >( GetWindow() ); } + vcl::Window* GetWindow() const + { + auto p = GetOutputDevice().get(); + return p ? p->GetOwnerWindow() : nullptr; + } void suspendVclEventListening( ); void resumeVclEventListening( ); |