diff options
Diffstat (limited to 'toolkit/source/helper/unowrapper.cxx')
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 01cef532a60f..34ca76ebd8d3 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -182,11 +182,13 @@ void UnoWrapper::SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Ref DBG_ASSERT( pVCLXWindow, "SetComponentInterface - unsupported type" ); if ( pVCLXWindow ) { - if( pWindow->GetWindowPeer() ) + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); + if( xPeer.is() ) { - int i = 0; - i++; - // OSL_FAIL( "UnoWrapper::SetWindowInterface: there already *is* a WindowInterface for this window!" ); + bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); + DBG_ASSERT( bSameInstance, "UnoWrapper::SetWindowInterface: there already *is* a WindowInterface for this window!" ); + if ( bSameInstance ) + return; } pVCLXWindow->SetWindow( pWindow ); pWindow->SetWindowPeer( xIFace, pVCLXWindow ); |