diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index 21386aedb3ec..48b593eb37fb 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -147,15 +147,16 @@ void VCLXTopWindow_Base::setMenuBar( const ::com::sun::star::uno::Reference< ::c { SolarMutexGuard aGuard; - SystemWindow* pWindow = dynamic_cast( GetWindowImpl() ); + vcl::Window* pWindow = GetWindowImpl(); if ( pWindow ) { - pWindow->SetMenuBar( NULL ); + SystemWindow* pSystemWindow = static_cast( pWindow ); + pSystemWindow->SetMenuBar( NULL ); if ( rxMenu.is() ) { VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu ); if ( pMenu && !pMenu->IsPopupMenu() ) - pWindow->SetMenuBar( static_cast( pMenu->GetMenu() )); + pSystemWindow->SetMenuBar( static_cast( pMenu->GetMenu() )); } } mxMenuBar = rxMenu; diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 7e93fe1c799e..2e34bde30433 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -80,7 +80,7 @@ void MenuFloatingWindow::doShutdown() } if( i < nCount ) { - MenuFloatingWindow* pPWin = dynamic_cast(pMenu->pStartedFrom->ImplGetWindow()); + MenuFloatingWindow* pPWin = static_cast(pMenu->pStartedFrom->ImplGetWindow()); if( pPWin ) pPWin->HighlightItem( i, false ); } @@ -682,7 +682,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime } if( i < nCount ) { - MenuFloatingWindow* pPWin = dynamic_cast(pMenu->pStartedFrom->ImplGetWindow()); + MenuFloatingWindow* pPWin = static_cast(pMenu->pStartedFrom->ImplGetWindow()); if( pPWin && pPWin->nHighlightedItem != i ) { pPWin->HighlightItem( i, true );