Kaydet (Commit) ad5e8b30 authored tarafından Noel Grandin's avatar Noel Grandin

fix for invalid dynamic_cast

after my loplugin-cstylecast commits.
this is a follow on to the bug reported in fdo#84608

Change-Id: Icc4f4baf3690e939c07a71a949200270bf1f4614
üst 552adfbb
...@@ -147,15 +147,16 @@ void VCLXTopWindow_Base::setMenuBar( const ::com::sun::star::uno::Reference< ::c ...@@ -147,15 +147,16 @@ void VCLXTopWindow_Base::setMenuBar( const ::com::sun::star::uno::Reference< ::c
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
SystemWindow* pWindow = dynamic_cast<SystemWindow*>( GetWindowImpl() ); vcl::Window* pWindow = GetWindowImpl();
if ( pWindow ) if ( pWindow )
{ {
pWindow->SetMenuBar( NULL ); SystemWindow* pSystemWindow = static_cast<SystemWindow*>( pWindow );
pSystemWindow->SetMenuBar( NULL );
if ( rxMenu.is() ) if ( rxMenu.is() )
{ {
VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu ); VCLXMenu* pMenu = VCLXMenu::GetImplementation( rxMenu );
if ( pMenu && !pMenu->IsPopupMenu() ) if ( pMenu && !pMenu->IsPopupMenu() )
pWindow->SetMenuBar( static_cast<MenuBar*>( pMenu->GetMenu() )); pSystemWindow->SetMenuBar( static_cast<MenuBar*>( pMenu->GetMenu() ));
} }
} }
mxMenuBar = rxMenu; mxMenuBar = rxMenu;
......
...@@ -80,7 +80,7 @@ void MenuFloatingWindow::doShutdown() ...@@ -80,7 +80,7 @@ void MenuFloatingWindow::doShutdown()
} }
if( i < nCount ) if( i < nCount )
{ {
MenuFloatingWindow* pPWin = dynamic_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->ImplGetWindow()); MenuFloatingWindow* pPWin = static_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->ImplGetWindow());
if( pPWin ) if( pPWin )
pPWin->HighlightItem( i, false ); pPWin->HighlightItem( i, false );
} }
...@@ -682,7 +682,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime ...@@ -682,7 +682,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime
} }
if( i < nCount ) if( i < nCount )
{ {
MenuFloatingWindow* pPWin = dynamic_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->ImplGetWindow()); MenuFloatingWindow* pPWin = static_cast<MenuFloatingWindow*>(pMenu->pStartedFrom->ImplGetWindow());
if( pPWin && pPWin->nHighlightedItem != i ) if( pPWin && pPWin->nHighlightedItem != i )
{ {
pPWin->HighlightItem( i, true ); pPWin->HighlightItem( i, true );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment