diff options
Diffstat (limited to 'framework/source')
29 files changed, 110 insertions, 109 deletions
diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index 965d4895762c..fd8ca5019c44 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -183,7 +183,7 @@ MenuManager::MenuManager( if ( nItemId == SID_NEWDOCDIRECT || aItemCommand == aSlotNewDocDirect ) { MenuConfiguration aMenuCfg( m_xContext ); - BmkMenu* pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_NEWMENU ); + BmkMenu* pSubMenu = static_cast<BmkMenu*>(aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_NEWMENU )); pMenu->SetPopupMenu( nItemId, pSubMenu ); AddMenu(pSubMenu,OUString(),nItemId,true,false); @@ -197,7 +197,7 @@ MenuManager::MenuManager( else if ( nItemId == SID_AUTOPILOTMENU || aItemCommand == aSlotAutoPilot ) { MenuConfiguration aMenuCfg( m_xContext ); - BmkMenu* pSubMenu = (BmkMenu*)aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_WIZARDMENU ); + BmkMenu* pSubMenu = static_cast<BmkMenu*>(aMenuCfg.CreateBookmarkMenu( rFrame, BOOKMARK_WIZARDMENU )); pMenu->SetPopupMenu( nItemId, pSubMenu ); AddMenu(pSubMenu,OUString(),nItemId,true,false); @@ -220,7 +220,7 @@ MenuManager::MenuManager( OUString aImageId; MenuConfiguration::Attributes* pMenuAttributes = - (MenuConfiguration::Attributes*)pMenu->GetUserValue( nItemId ); + reinterpret_cast<MenuConfiguration::Attributes*>(pMenu->GetUserValue( nItemId )); if ( pMenuAttributes && !pMenuAttributes->aImageId.isEmpty() ) { @@ -944,7 +944,7 @@ void MenuManager::FillMenuImages(Reference< XFrame >& _xFrame, Menu* _pMenu,bool OUString aImageId; ::framework::MenuConfiguration::Attributes* pMenuAttributes = - (::framework::MenuConfiguration::Attributes*)_pMenu->GetUserValue( nId ); + reinterpret_cast<::framework::MenuConfiguration::Attributes*>(_pMenu->GetUserValue( nId )); if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx index 62a550e0adad..0762c747212e 100644 --- a/framework/source/dispatch/menudispatcher.cxx +++ b/framework/source/dispatch/menudispatcher.cxx @@ -127,7 +127,7 @@ void SAL_CALL MenuDispatcher::frameAction( const FrameActionEvent& aEvent ) thro if ( m_pMenuManager && aEvent.Action == FrameAction_FRAME_UI_ACTIVATED ) { - MenuBar* pMenuBar = (MenuBar *)m_pMenuManager->GetMenu(); + MenuBar* pMenuBar = static_cast<MenuBar *>(m_pMenuManager->GetMenu()); uno::Reference< XFrame > xFrame( m_xOwnerWeak.get(), UNO_QUERY ); aGuard.clear(); @@ -143,7 +143,7 @@ void SAL_CALL MenuDispatcher::frameAction( const FrameActionEvent& aEvent ) thro if ( pWindow ) { - SystemWindow* pSysWindow = (SystemWindow *)pWindow; + SystemWindow* pSysWindow = static_cast<SystemWindow *>(pWindow); pSysWindow->SetMenuBar( pMenuBar ); } } @@ -226,7 +226,7 @@ bool MenuDispatcher::impl_setMenuBar( MenuBar* pMenuBar, bool bMenuFromResource if ( pWindow ) { - SystemWindow* pSysWindow = (SystemWindow *)pWindow; + SystemWindow* pSysWindow = static_cast<SystemWindow *>(pWindow); if ( m_pMenuManager ) { diff --git a/framework/source/fwe/classes/addonmenu.cxx b/framework/source/fwe/classes/addonmenu.cxx index 7e6720d950b6..acdbec33eef6 100644 --- a/framework/source/fwe/classes/addonmenu.cxx +++ b/framework/source/fwe/classes/addonmenu.cxx @@ -60,7 +60,7 @@ AddonMenu::~AddonMenu() { // delete user attributes created with new! sal_uInt16 nId = GetItemId( i ); - MenuConfiguration::Attributes* pUserAttributes = (MenuConfiguration::Attributes*)GetUserValue( nId ); + MenuConfiguration::Attributes* pUserAttributes = reinterpret_cast<MenuConfiguration::Attributes*>(GetUserValue( nId )); delete pUserAttributes; delete GetPopupMenu( nId ); } @@ -128,7 +128,7 @@ AddonMenu* AddonMenuManager::CreateAddonMenu( const Reference< XFrame >& rFrame, const Sequence< Sequence< PropertyValue > >& rAddonMenuEntries = aOptions.GetAddonsMenu(); if ( rAddonMenuEntries.getLength() > 0 ) { - pAddonMenu = (AddonMenu *)AddonMenuManager::CreatePopupMenuType( ADDON_MENU, rFrame ); + pAddonMenu = static_cast<AddonMenu *>(AddonMenuManager::CreatePopupMenuType( ADDON_MENU, rFrame )); ::rtl::OUString aModuleIdentifier = GetModuleIdentifier( rContext, rFrame ); AddonMenuManager::BuildMenu( pAddonMenu, ADDON_MENU, MENU_APPEND, nUniqueMenuId, rAddonMenuEntries, rFrame, aModuleIdentifier ); @@ -249,7 +249,7 @@ void AddonMenuManager::MergeAddonPopupMenus( const Reference< XFrame >& rFrame, AddonMenuManager::IsCorrectContext( aModuleIdentifier, aContext )) { sal_uInt16 nId = nUniqueMenuId++; - AddonPopupMenu* pAddonPopupMenu = (AddonPopupMenu *)AddonMenuManager::CreatePopupMenuType( ADDON_POPUPMENU, rFrame ); + AddonPopupMenu* pAddonPopupMenu = static_cast<AddonPopupMenu *>(AddonMenuManager::CreatePopupMenuType( ADDON_POPUPMENU, rFrame )); AddonMenuManager::BuildMenu( pAddonPopupMenu, ADDON_MENU, MENU_APPEND, nUniqueMenuId, aAddonSubMenu, rFrame, aModuleIdentifier ); diff --git a/framework/source/fwe/classes/bmkmenu.cxx b/framework/source/fwe/classes/bmkmenu.cxx index 0973ca12cf38..550da2a9a6ca 100644 --- a/framework/source/fwe/classes/bmkmenu.cxx +++ b/framework/source/fwe/classes/bmkmenu.cxx @@ -164,7 +164,7 @@ void BmkMenu::Initialize() InsertItem( nId, aTitle ); MenuConfiguration::Attributes* pUserAttributes = new MenuConfiguration::Attributes( aTargetFrame, aImageId ); - SetUserValue( nId, (sal_uIntPtr)pUserAttributes ); + SetUserValue( nId, reinterpret_cast<sal_uIntPtr>(pUserAttributes) ); SetItemCommand( nId, aURL ); } diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index 2f50a3e691ce..5ddf1252fb4a 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -274,7 +274,7 @@ void TitleHelper::impl_sendTitleChangedEvent () { try { - ((css::frame::XTitleChangeListener*)pIt.next())->titleChanged( aEvent ); + static_cast<css::frame::XTitleChangeListener*>(pIt.next())->titleChanged( aEvent ); } catch(const css::uno::Exception&) { diff --git a/framework/source/fwi/classes/propertysethelper.cxx b/framework/source/fwi/classes/propertysethelper.cxx index 8265f3456a31..9e7b04bb18a1 100644 --- a/framework/source/fwi/classes/propertysethelper.cxx +++ b/framework/source/fwi/classes/propertysethelper.cxx @@ -112,7 +112,7 @@ bool PropertySetHelper::impl_existsVeto(const css::beans::PropertyChangeEvent& a try { css::uno::Reference< css::beans::XVetoableChangeListener > xListener( - ((css::beans::XVetoableChangeListener*)pListener.next()), + static_cast<css::beans::XVetoableChangeListener*>(pListener.next()), css::uno::UNO_QUERY_THROW); xListener->vetoableChange(aEvent); } @@ -141,7 +141,7 @@ void PropertySetHelper::impl_notifyChangeListener(const css::beans::PropertyChan try { css::uno::Reference< css::beans::XPropertyChangeListener > xListener( - ((css::beans::XVetoableChangeListener*)pListener.next()), + static_cast<css::beans::XVetoableChangeListener*>(pListener.next()), css::uno::UNO_QUERY_THROW); xListener->propertyChange(aEvent); } diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx index 168442c55bb2..307adcf24ff1 100644 --- a/framework/source/helper/statusindicator.cxx +++ b/framework/source/helper/statusindicator.cxx @@ -43,7 +43,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText , css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory); if (xFactory.is()) { - StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get(); + StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get()); pFactory->start(this, sText, nRange); } #endif @@ -56,7 +56,7 @@ void SAL_CALL StatusIndicator::end() css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory); if (xFactory.is()) { - StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get(); + StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get()); pFactory->end(this); } #endif @@ -69,7 +69,7 @@ void SAL_CALL StatusIndicator::reset() css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory); if (xFactory.is()) { - StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get(); + StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get()); pFactory->reset(this); } #endif @@ -84,7 +84,7 @@ void SAL_CALL StatusIndicator::setText(const OUString& sText) css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory); if (xFactory.is()) { - StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get(); + StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get()); pFactory->setText(this, sText); } #endif @@ -99,7 +99,7 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue) css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory); if (xFactory.is()) { - StatusIndicatorFactory* pFactory = (StatusIndicatorFactory*)xFactory.get(); + StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get()); pFactory->setValue(this, nValue); } #endif diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx index c7958acafeb1..ca623fff4730 100644 --- a/framework/source/layoutmanager/helpers.cxx +++ b/framework/source/layoutmanager/helpers.cxx @@ -123,7 +123,7 @@ SystemWindow* getTopSystemWindow( const uno::Reference< awt::XWindow >& xWindow pWindow = pWindow->GetParent(); if ( pWindow ) - return (SystemWindow *)pWindow; + return static_cast<SystemWindow *>(pWindow); else return 0; } @@ -153,7 +153,7 @@ bool lcl_checkUIElement(const uno::Reference< ui::XUIElement >& xUIElement, awt: vcl::Window* pWindow = VCLUnoHelper::GetWindow( _xWindow ); if ( pWindow->GetType() == WINDOW_TOOLBOX ) { - ::Size aSize = ((ToolBox*)pWindow)->CalcWindowSizePixel( 1 ); + ::Size aSize = static_cast<ToolBox*>(pWindow)->CalcWindowSizePixel( 1 ); _rPosSize.Width = aSize.Width(); _rPosSize.Height = aSize.Height(); } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 2aa797be911c..c17a2e365072 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1540,7 +1540,7 @@ void LoadEnv::impl_reactForLoadingState() vcl::Window* pWindow = VCLUnoHelper::GetWindow(xWindow); // check for system window is necessary to guarantee correct pointer cast! if (pWindow && pWindow->IsSystemWindow()) - ((WorkWindow*)pWindow)->Minimize(); + static_cast<WorkWindow*>(pWindow)->Minimize(); } else if (!bHidden) { @@ -1702,7 +1702,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw return; // dont overwrite this special state! - WorkWindow* pWorkWindow = (WorkWindow*)pWindow; + WorkWindow* pWorkWindow = static_cast<WorkWindow*>(pWindow); if (pWorkWindow->IsMinimized()) return; @@ -1759,7 +1759,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw if (! pWindowCheck) return; - SystemWindow* pSystemWindow = (SystemWindow*)pWindowCheck; + SystemWindow* pSystemWindow = static_cast<SystemWindow*>(pWindowCheck); pSystemWindow->SetWindowState(OUStringToOString(sWindowState,RTL_TEXTENCODING_UTF8)); // <- SOLAR SAFE } diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx index 4948ad5dbe99..97263ecc7462 100644 --- a/framework/source/tabwin/tabwindow.cxx +++ b/framework/source/tabwin/tabwindow.cxx @@ -142,7 +142,7 @@ TabControl* TabWindow::impl_GetTabControl( const css::uno::Reference< css::awt:: { vcl::Window* pWindow = VCLUnoHelper::GetWindow( rTabControlWindow ); if ( pWindow ) - return (TabControl *)pWindow; + return static_cast<TabControl *>(pWindow); else return NULL; } @@ -173,16 +173,16 @@ void TabWindow::implts_SendNotification( Notification eNotify, sal_Int32 ID ) co switch ( eNotify ) { case NOTIFY_INSERTED: - ((css::awt::XTabListener*)pIterator.next())->inserted( ID ); + static_cast<css::awt::XTabListener*>(pIterator.next())->inserted( ID ); break; case NOTIFY_REMOVED: - ((css::awt::XTabListener*)pIterator.next())->removed( ID ); + static_cast<css::awt::XTabListener*>(pIterator.next())->removed( ID ); break; case NOTIFY_ACTIVATED: - ((css::awt::XTabListener*)pIterator.next())->activated( ID ); + static_cast<css::awt::XTabListener*>(pIterator.next())->activated( ID ); break; case NOTIFY_DEACTIVATED: - ((css::awt::XTabListener*)pIterator.next())->deactivated( ID ); + static_cast<css::awt::XTabListener*>(pIterator.next())->deactivated( ID ); break; default: break; @@ -210,7 +210,7 @@ void TabWindow::implts_SendNotification( Notification eNotify, sal_Int32 ID, con switch ( eNotify ) { case NOTIFY_CHANGED: - ((css::awt::XTabListener*)pIterator.next())->changed( ID, rSeq ); + static_cast<css::awt::XTabListener*>(pIterator.next())->changed( ID, rSeq ); break; default: break; @@ -399,7 +399,7 @@ throw (css::uno::Exception, css::uno::RuntimeException, std::exception) if ( pWindow ) { pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); - TabControl* pTabControl = (TabControl *)pWindow; + TabControl* pTabControl = static_cast<TabControl *>(pWindow); pTabControl->SetActivatePageHdl( LINK( this, TabWindow, Activate )); pTabControl->SetDeactivatePageHdl( LINK( this, TabWindow, Deactivate )); } diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 1c556530d519..9a718d74ade0 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -1368,13 +1368,13 @@ void ImageManagerImpl::implts_notifyContainerListener( const ConfigurationEvent& switch ( eOp ) { case NotifyOp_Replace: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementReplaced( aEvent ); break; case NotifyOp_Insert: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementInserted( aEvent ); break; case NotifyOp_Remove: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementRemoved( aEvent ); break; } } diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 71560d765039..d247f14e4907 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -1693,13 +1693,13 @@ void ModuleUIConfigurationManager::implts_notifyContainerListener( const ui::Con switch ( eOp ) { case NotifyOp_Replace: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementReplaced( aEvent ); break; case NotifyOp_Insert: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementInserted( aEvent ); break; case NotifyOp_Remove: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementRemoved( aEvent ); break; } } diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index df9115fe231a..27dc2ef48e0e 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -1228,7 +1228,7 @@ void SAL_CALL UIConfigurationManager::setStorage( const Reference< XStorage >& S if ( m_xImageManager.is() ) { - ImageManager* pImageManager = (ImageManager*)m_xImageManager.get(); + ImageManager* pImageManager = static_cast<ImageManager*>(m_xImageManager.get()); if ( pImageManager ) pImageManager->setStorage( m_xDocConfigStorage ); } @@ -1400,13 +1400,13 @@ void UIConfigurationManager::implts_notifyContainerListener( const Configuration switch ( eOp ) { case NotifyOp_Replace: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementReplaced( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementReplaced( aEvent ); break; case NotifyOp_Insert: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementInserted( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementInserted( aEvent ); break; case NotifyOp_Remove: - ((::com::sun::star::ui::XUIConfigurationListener*)pIterator.next())->elementRemoved( aEvent ); + static_cast<::com::sun::star::ui::XUIConfigurationListener*>(pIterator.next())->elementRemoved( aEvent ); break; } } 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 ) ) |