diff options
Diffstat (limited to 'framework/source/uielement')
16 files changed, 69 insertions, 68 deletions
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index 9c78c1c4efa5..c11c2e50d0d3 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -278,14 +278,14 @@ void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu ) // private function void ControlMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); PopupMenu* pVCLPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu && m_pResPopupMenu ) *pVCLPopupMenu = *m_pResPopupMenu; @@ -324,13 +324,13 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve VCLXPopupMenu* pPopupMenu = NULL; if ( nMenuId ) - pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( m_xPopupMenu ); + pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( m_xPopupMenu )); if (pPopupMenu) { SolarMutexGuard aSolarMutexGuard; - PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( !Event.IsEnabled && pVCLPopupMenu->GetItemPos( nMenuId ) != MENU_ITEM_NOTFOUND ) pVCLPopupMenu->RemoveItem( pVCLPopupMenu->GetItemPos( nMenuId )); @@ -390,10 +390,10 @@ void SAL_CALL ControlMenuController::itemActivated( const css::awt::MenuEvent& ) { m_bShowMenuImages = bShowMenuImages; - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( m_xPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXPopupMenu::GetImplementation( m_xPopupMenu )); if ( pPopupMenu ) { - PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu && bUpdateImages ) updateImagesPopupMenu( pVCLPopupMenu ); } diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx index 23d74535b6c9..d0a287eb16df 100644 --- a/framework/source/uielement/fontmenucontroller.cxx +++ b/framework/source/uielement/fontmenucontroller.cxx @@ -75,14 +75,14 @@ FontMenuController::~FontMenuController() void FontMenuController::fillPopupMenu( const Sequence< OUString >& rFontNameSeq, Reference< css::awt::XPopupMenu >& rPopupMenu ) { const OUString* pFontNameArray = rFontNameSeq.getConstArray(); - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); - PopupMenu* pVCLPopupMenu = 0; + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); + PopupMenu* pVCLPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu ) { diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index 026986b44705..88dd46e62cab 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -125,12 +125,12 @@ void FontSizeMenuController::setCurHeight( long nHeight, Reference< css::awt::XP // private function void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); PopupMenu* pVCLPopupMenu = 0; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu ) { diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx index c4ca0d2673fc..6e9cdd5e6ede 100644 --- a/framework/source/uielement/headermenucontroller.cxx +++ b/framework/source/uielement/headermenucontroller.cxx @@ -74,14 +74,14 @@ HeaderMenuController::~HeaderMenuController() // private function void HeaderMenuController::fillPopupMenu( const Reference< ::com::sun::star::frame::XModel >& rModel, Reference< css::awt::XPopupMenu >& rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); - PopupMenu* pVCLPopupMenu = 0; + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); + PopupMenu* pVCLPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); Reference< XStyleFamiliesSupplier > xStyleFamiliesSupplier( rModel, UNO_QUERY ); if ( pVCLPopupMenu && xStyleFamiliesSupplier.is()) diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx index 60784531249a..0780d0552b47 100644 --- a/framework/source/uielement/langselectionmenucontroller.cxx +++ b/framework/source/uielement/langselectionmenucontroller.cxx @@ -190,7 +190,7 @@ void LanguageSelectionMenuController::impl_setPopupMenu() void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu , const Mode eMode ) { - VCLXPopupMenu* pVCLPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); PopupMenu* pPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; @@ -200,7 +200,7 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup return; if ( pVCLPopupMenu ) - pPopupMenu = (PopupMenu *)pVCLPopupMenu->GetMenu(); + pPopupMenu = static_cast<PopupMenu *>(pVCLPopupMenu->GetMenu()); OUString aCmd; OUString aCmd_Dialog; diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 8801667efddb..2c168d1e1833 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -71,14 +71,14 @@ MacrosMenuController::~MacrosMenuController() // private function void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) { - VCLXPopupMenu* pVCLPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); PopupMenu* pPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pVCLPopupMenu ) - pPopupMenu = (PopupMenu *)pVCLPopupMenu->GetMenu(); + pPopupMenu = static_cast<PopupMenu *>(pVCLPopupMenu->GetMenu()); if (!pPopupMenu) return; diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 772a662b9a50..057bc0ccc20b 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -546,7 +546,7 @@ void MenuBarManager::RequestImages() MenuItemHandler* pItemHandler = m_aMenuItemHandlerVector[i]; if ( pItemHandler->xSubMenuManager.is() ) { - MenuBarManager* pMenuBarManager = (MenuBarManager*)(pItemHandler->xSubMenuManager.get()); + MenuBarManager* pMenuBarManager = static_cast<MenuBarManager*>(pItemHandler->xSubMenuManager.get()); pMenuBarManager->RequestImages(); } } @@ -1187,13 +1187,13 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF if ( nItemId == SID_MDIWINDOWLIST || aCommand == aSpecialWindowCommand) { // Retrieve addon popup menus and add them to our menu bar - framework::AddonMenuManager::MergeAddonPopupMenus( rFrame, nPos, (MenuBar *)pMenu, m_xContext ); + framework::AddonMenuManager::MergeAddonPopupMenus( rFrame, nPos, static_cast<MenuBar *>(pMenu), m_xContext ); break; } } // Merge the Add-Ons help menu items into the Office help menu - framework::AddonMenuManager::MergeAddonHelpMenu( rFrame, (MenuBar *)pMenu, m_xContext ); + framework::AddonMenuManager::MergeAddonHelpMenu( rFrame, static_cast<MenuBar *>(pMenu), m_xContext ); } OUString aEmpty; @@ -1249,7 +1249,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF // works with inplace OLE. Remove old dummy popup menu! MenuItemHandler* pItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch ); VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu; - PopupMenu* pNewPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu(); + PopupMenu* pNewPopupMenu = static_cast<PopupMenu *>(pVCLXPopupMenu->GetMenu()); pMenu->SetPopupMenu( nItemId, pNewPopupMenu ); pItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY ); pItemHandler->aMenuItemURL = aItemCommand; @@ -1267,7 +1267,8 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF ( aItemCommand.startsWith( ADDONSPOPUPMENU_URL_PREFIX ) )) { // A special addon popup menu, must be created with a different ctor - MenuBarManager* pSubMenuManager = new MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer,(AddonPopupMenu *)pPopup, bDeleteChildren, bDeleteChildren ); + MenuBarManager* pSubMenuManager = new MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer, + static_cast<AddonPopupMenu *>(pPopup), bDeleteChildren, bDeleteChildren ); AddMenu(pSubMenuManager,aItemCommand,nItemId); } else @@ -1275,7 +1276,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF Reference< XDispatchProvider > xPopupMenuDispatchProvider( rDispatchProvider ); // Retrieve possible attributes struct - MenuConfiguration::Attributes* pAttributes = (MenuConfiguration::Attributes *)(pMenu->GetUserValue( nItemId )); + MenuConfiguration::Attributes* pAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pMenu->GetUserValue( nItemId )); if ( pAttributes ) xPopupMenuDispatchProvider = pAttributes->xDispatchProvider; @@ -1346,7 +1347,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF OUString aImageId; MenuConfiguration::Attributes* pMenuAttributes = - (MenuConfiguration::Attributes*)pMenu->GetUserValue( nItemId ); + reinterpret_cast<MenuConfiguration::Attributes*>(pMenu->GetUserValue( nItemId )); if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() ) { @@ -1379,7 +1380,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF // We have to set an empty popup menu into our menu structure so the controller also // works with inplace OLE. VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu; - PopupMenu* pPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu(); + PopupMenu* pPopupMenu = static_cast<PopupMenu *>(pVCLXPopupMenu->GetMenu()); pMenu->SetPopupMenu( pItemHandler->nItemId, pPopupMenu ); pItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY ); @@ -1708,7 +1709,7 @@ void MenuBarManager::FillMenu( // Use attributes struct to transport special dispatch provider MenuConfiguration::Attributes* pAttributes = new MenuConfiguration::Attributes; pAttributes->xDispatchProvider = xDispatchProvider; - pMenu->SetUserValue( nId, (sal_uIntPtr)( pAttributes )); + pMenu->SetUserValue( nId, reinterpret_cast<sal_uIntPtr>( pAttributes )); } // Use help command to transport module identifier @@ -1884,7 +1885,7 @@ void MenuBarManager::GetPopupController( PopupControllerCache& rPopupController } if ( pItemHandler->xSubMenuManager.is() ) { - MenuBarManager* pMenuBarManager = (MenuBarManager*)(pItemHandler->xSubMenuManager.get()); + MenuBarManager* pMenuBarManager = static_cast<MenuBarManager*>(pItemHandler->xSubMenuManager.get()); if ( pMenuBarManager ) pMenuBarManager->GetPopupController( rPopupController ); } @@ -1964,7 +1965,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen { if ( pAddonMenu->GetItemType( i ) != MENUITEM_SEPARATOR ) { - MenuConfiguration::Attributes* pAddonAttributes = (MenuConfiguration::Attributes *)(pAddonMenu->GetUserValue( nItemId )); + MenuConfiguration::Attributes* pAddonAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pAddonMenu->GetUserValue( nItemId )); MenuItemHandler* pMenuItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch ); if ( pAddonAttributes ) @@ -1983,7 +1984,7 @@ void MenuBarManager::Init(const Reference< XFrame >& rFrame,AddonMenu* pAddonMen m_xPopupMenuControllerFactory->hasController( aItemCommand, OUString() )) { VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu; - PopupMenu* pCtlPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu(); + PopupMenu* pCtlPopupMenu = static_cast<PopupMenu *>(pVCLXPopupMenu->GetMenu()); pAddonMenu->SetPopupMenu( pMenuItemHandler->nItemId, pCtlPopupMenu ); pMenuItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY ); diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index fe473bc36324..a827b8a535cc 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -313,14 +313,14 @@ NewMenuController::~NewMenuController() // private function void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); PopupMenu* pVCLPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu ) { @@ -328,9 +328,9 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup boost::scoped_ptr<BmkMenu> pSubMenu; if ( m_bNewMenu ) - pSubMenu.reset((BmkMenu*)aMenuCfg.CreateBookmarkMenu( m_xFrame, BOOKMARK_NEWMENU )); + pSubMenu.reset(static_cast<BmkMenu*>(aMenuCfg.CreateBookmarkMenu( m_xFrame, BOOKMARK_NEWMENU ))); else - pSubMenu.reset((BmkMenu*)aMenuCfg.CreateBookmarkMenu( m_xFrame, BOOKMARK_WIZARDMENU )); + pSubMenu.reset(static_cast<BmkMenu*>(aMenuCfg.CreateBookmarkMenu( m_xFrame, BOOKMARK_WIZARDMENU ))); // copy entries as we have to use the provided popup menu *pVCLPopupMenu = *pSubMenu; @@ -346,7 +346,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup if (( nItemId != 0 ) && ( pSubMenu->GetItemType( nItemId ) != MENUITEM_SEPARATOR )) { - MenuConfiguration::Attributes* pBmkAttributes = (MenuConfiguration::Attributes *)(pSubMenu->GetUserValue( nItemId )); + MenuConfiguration::Attributes* pBmkAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pSubMenu->GetUserValue( nItemId )); if ( pBmkAttributes != 0 ) { aAddInfo.aTargetFrame = pBmkAttributes->aTargetFrame; @@ -403,12 +403,12 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent if ( xPopupMenu.is() && xDispatchProvider.is() ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXPopupMenu::GetImplementation( xPopupMenu )); if ( pPopupMenu ) { { SolarMutexGuard aSolarMutexGuard; - PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); aTargetURL.Complete = pVCLPopupMenu->GetItemCommand( rEvent.MenuId ); } @@ -444,13 +444,13 @@ void SAL_CALL NewMenuController::itemActivated( const css::awt::MenuEvent& ) thr SolarMutexGuard aSolarMutexGuard; if ( m_xFrame.is() && m_xPopupMenu.is() ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( m_xPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXPopupMenu::GetImplementation( m_xPopupMenu )); if ( pPopupMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); bool bShowImages( rSettings.GetUseImagesInMenus() ); - PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( m_bShowImages != bShowImages ) { diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx index c00d164ef1f0..f2a18f07b8f1 100644 --- a/framework/source/uielement/objectmenucontroller.cxx +++ b/framework/source/uielement/objectmenucontroller.cxx @@ -105,15 +105,15 @@ ObjectMenuController::~ObjectMenuController() // private function void ObjectMenuController::fillPopupMenu( const Sequence< com::sun::star::embed::VerbDescriptor >& rVerbCommandSeq, Reference< css::awt::XPopupMenu >& rPopupMenu ) { - const com::sun::star::embed::VerbDescriptor* pVerbCommandArray = rVerbCommandSeq.getConstArray(); - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); - PopupMenu* pVCLPopupMenu = 0; + const css::embed::VerbDescriptor* pVerbCommandArray = rVerbCommandSeq.getConstArray(); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); + PopupMenu* pVCLPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu ) { diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 2667884e748e..10617f6e0906 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -433,7 +433,7 @@ throw ( css::uno::RuntimeException, std::exception ) // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu MenuConfiguration::Attributes* pMenuAttributes( 0 ); VCLXPopupMenu* pTkPopupMenu = - ( VCLXPopupMenu * ) VCLXMenu::GetImplementation( m_xPopupMenu ); + static_cast<VCLXPopupMenu *>( VCLXMenu::GetImplementation( m_xPopupMenu ) ); SolarMutexGuard aSolarMutexGuard; PopupMenu* pVCLPopupMenu = pTkPopupMenu ? diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx index 8a47769cd667..b441d83ed6b7 100644 --- a/framework/source/uielement/progressbarwrapper.cxx +++ b/framework/source/uielement/progressbarwrapper.cxx @@ -107,7 +107,7 @@ void ProgressBarWrapper::start( const OUString& Text, ::sal_Int32 Range ) vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR ) { - StatusBar* pStatusBar = (StatusBar *)pWindow; + StatusBar* pStatusBar = static_cast<StatusBar *>(pWindow); if ( !pStatusBar->IsProgressMode() ) pStatusBar->StartProgressMode( Text ); else @@ -145,7 +145,7 @@ void ProgressBarWrapper::end() vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR ) { - StatusBar* pStatusBar = (StatusBar *)pWindow; + StatusBar* pStatusBar = static_cast<StatusBar *>(pWindow); if ( pStatusBar->IsProgressMode() ) pStatusBar->EndProgressMode(); } @@ -175,7 +175,7 @@ void ProgressBarWrapper::setText( const OUString& Text ) vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR ) { - StatusBar* pStatusBar = (StatusBar *)pWindow; + StatusBar* pStatusBar = static_cast<StatusBar *>(pWindow); if( pStatusBar->IsProgressMode() ) { pStatusBar->SetUpdateMode( false ); @@ -228,7 +228,7 @@ void ProgressBarWrapper::setValue( ::sal_Int32 nValue ) vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR ) { - StatusBar* pStatusBar = (StatusBar *)pWindow; + StatusBar* pStatusBar = static_cast<StatusBar *>(pWindow); if ( !pStatusBar->IsProgressMode() ) pStatusBar->StartProgressMode( aText ); pStatusBar->SetProgressValue( sal_uInt16( nValue )); diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 7fa92a6b5f41..9bbca7e71ad8 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -129,14 +129,14 @@ RecentFilesMenuController::~RecentFilesMenuController() // private function void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu )); PopupMenu* pVCLPopupMenu = 0; SolarMutexGuard aSolarMutexGuard; resetPopupMenu( rPopupMenu ); if ( pPopupMenu ) - pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( pVCLPopupMenu ) { diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx index d9fd8e1cbe46..7d5322f12e8a 100644 --- a/framework/source/uielement/statusbarwrapper.cxx +++ b/framework/source/uielement/statusbarwrapper.cxx @@ -112,7 +112,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments ) pStatusBar = new FrameworkStatusBar( pWindow, nStyles ); pStatusBarManager = new StatusBarManager( m_xContext, xFrame, m_aResourceURL, pStatusBar ); - ((FrameworkStatusBar*)pStatusBar)->SetStatusBarManager( pStatusBarManager ); + static_cast<FrameworkStatusBar*>(pStatusBar)->SetStatusBarManager( pStatusBarManager ); m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY ); pStatusBar->SetUniqueId( HID_STATUSBAR ); } diff --git a/framework/source/uielement/statusindicatorinterfacewrapper.cxx b/framework/source/uielement/statusindicatorinterfacewrapper.cxx index 4c107009b189..9108ceb13fc4 100644 --- a/framework/source/uielement/statusindicatorinterfacewrapper.cxx +++ b/framework/source/uielement/statusindicatorinterfacewrapper.cxx @@ -49,7 +49,7 @@ throw( ::com::sun::star::uno::RuntimeException, std::exception ) Reference< XComponent > xComp( m_xStatusIndicatorImpl ); if ( xComp.is() ) { - ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); + ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get()); if ( pProgressBar ) pProgressBar->start( sText, nRange ); } @@ -61,7 +61,7 @@ throw( ::com::sun::star::uno::RuntimeException, std::exception ) Reference< XComponent > xComp( m_xStatusIndicatorImpl ); if ( xComp.is() ) { - ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); + ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get()); if ( pProgressBar ) pProgressBar->end(); } @@ -73,7 +73,7 @@ throw( ::com::sun::star::uno::RuntimeException, std::exception ) Reference< XComponent > xComp( m_xStatusIndicatorImpl ); if ( xComp.is() ) { - ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); + ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get()); if ( pProgressBar ) pProgressBar->reset(); } @@ -86,7 +86,7 @@ throw( ::com::sun::star::uno::RuntimeException, std::exception ) Reference< XComponent > xComp( m_xStatusIndicatorImpl ); if ( xComp.is() ) { - ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); + ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get()); if ( pProgressBar ) pProgressBar->setText( sText ); } @@ -99,7 +99,7 @@ throw( ::com::sun::star::uno::RuntimeException, std::exception ) Reference< XComponent > xComp( m_xStatusIndicatorImpl ); if ( xComp.is() ) { - ProgressBarWrapper* pProgressBar = (ProgressBarWrapper*)xComp.get(); + ProgressBarWrapper* pProgressBar = static_cast<ProgressBarWrapper*>(xComp.get()); if ( pProgressBar ) pProgressBar->setValue( nValue ); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 8f2de7398760..555d9672ba3b 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -202,7 +202,7 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext, pWindow = pWindow->GetParent(); if ( pWindow ) - ((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( m_pToolBar ); + static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->AddWindow( m_pToolBar ); m_xToolbarControllerFactory = frame::theToolbarControllerFactory::get( m_xContext ); m_xURLTransformer = URLTransformer::create( m_xContext ); @@ -258,7 +258,7 @@ void ToolBarManager::Destroy() pWindow = pWindow->GetParent(); if ( pWindow ) - ((SystemWindow *)pWindow)->GetTaskPaneList()->RemoveWindow( m_pToolBar ); + static_cast<SystemWindow *>(pWindow)->GetTaskPaneList()->RemoveWindow( m_pToolBar ); m_bAddedToTaskPaneList = false; } @@ -537,7 +537,7 @@ void SAL_CALL ToolBarManager::disposing( const EventObject& Source ) throw ( Run if ( m_xImageOrientationListener.is() ) { ImageOrientationListener* pImageOrientation = - (ImageOrientationListener*)m_xImageOrientationListener.get(); + static_cast<ImageOrientationListener*>(m_xImageOrientationListener.get()); pImageOrientation->unbindListener(); m_xImageOrientationListener.clear(); } @@ -615,7 +615,7 @@ void SAL_CALL ToolBarManager::dispose() throw( RuntimeException, std::exception if ( m_xImageOrientationListener.is() ) { ImageOrientationListener* pImageOrientation = - (ImageOrientationListener*)m_xImageOrientationListener.get(); + static_cast<ImageOrientationListener*>(m_xImageOrientationListener.get()); pImageOrientation->unbindListener(); m_xImageOrientationListener.clear(); } diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 8a5f5c1fa68a..ebbb01c37d14 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -177,10 +177,10 @@ void ToolbarsMenuController::addCommand( if ( rSettings.GetUseImagesInMenus() ) aImage = GetImageFromURL( m_xFrame, rCommandURL, false ); - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( rPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXPopupMenu::GetImplementation( rPopupMenu )); if ( pPopupMenu ) { - PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); if ( !!aImage ) pVCLPopupMenu->SetItemImage( nItemId, aImage ); } @@ -440,8 +440,8 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r { SolarMutexGuard aGuard; - VCLXPopupMenu* pXPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( m_xPopupMenu ); - PopupMenu* pVCLPopupMenu = pXPopupMenu ? (PopupMenu *)pXPopupMenu->GetMenu() : NULL; + VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( m_xPopupMenu )); + PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : NULL; assert(pVCLPopupMenu); if (pVCLPopupMenu) pVCLPopupMenu->SetUserValue( nIndex, sal_uIntPtr( aSortedTbs[i].bContextSensitive ? 1L : 0L )); @@ -552,8 +552,8 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev if ( xPopupMenu.is() ) { SolarMutexGuard aGuard; - VCLXPopupMenu* pXPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( xPopupMenu ); - PopupMenu* pVCLPopupMenu = pXPopupMenu ? (PopupMenu *)pXPopupMenu->GetMenu() : NULL; + VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( xPopupMenu )); + PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu *>(pXPopupMenu->GetMenu()) : NULL; assert(pVCLPopupMenu); if (!pVCLPopupMenu) @@ -608,11 +608,11 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& r if ( xPopupMenu.is() ) { - VCLXPopupMenu* pPopupMenu = (VCLXPopupMenu *)VCLXPopupMenu::GetImplementation( xPopupMenu ); + VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXPopupMenu::GetImplementation( xPopupMenu )); if ( pPopupMenu ) { SolarMutexGuard aSolarMutexGuard; - PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); + PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); OUString aCmd( pVCLPopupMenu->GetItemCommand( rEvent.MenuId )); if ( aCmd.startsWith( STATIC_INTERNAL_CMD_PART ) ) |