accessibility/source/extended/accessibletablistboxtable.cxx | 4 accessibility/source/helper/characterattributeshelper.cxx | 4 accessibility/source/standard/accessiblemenubasecomponent.cxx | 4 accessibility/source/standard/vclxaccessiblebutton.cxx | 10 accessibility/source/standard/vclxaccessiblemenubar.cxx | 6 accessibility/source/standard/vclxaccessiblestatusbar.cxx | 10 accessibility/source/standard/vclxaccessibletabcontrol.cxx | 10 accessibility/source/standard/vclxaccessibletoolbox.cxx | 14 - basic/source/classes/eventatt.cxx | 20 - basic/source/classes/image.cxx | 2 basic/source/classes/sb.cxx | 24 +- basic/source/classes/sbunoobj.cxx | 34 +-- basic/source/classes/sbxmod.cxx | 20 - basic/source/comp/codegen.cxx | 4 basic/source/comp/sbcomp.cxx | 2 basic/source/runtime/ddectrl.cxx | 2 basic/source/runtime/methods1.cxx | 8 basic/source/runtime/stdobj.cxx | 2 basic/source/sbx/sbxarray.cxx | 6 basic/source/sbx/sbxcoll.cxx | 6 basic/source/sbx/sbxcurr.cxx | 2 basic/source/sbx/sbxobj.cxx | 20 - basic/source/sbx/sbxvalue.cxx | 2 basic/source/sbx/sbxvar.cxx | 2 drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx | 2 drawinglayer/source/primitive2d/bitmapprimitive2d.cxx | 2 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx | 2 drawinglayer/source/primitive2d/clippedborderlineprimitive2d.cxx | 2 drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx | 2 drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx | 2 drawinglayer/source/primitive2d/epsprimitive2d.cxx | 2 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx | 2 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx | 2 drawinglayer/source/primitive2d/gridprimitive2d.cxx | 2 drawinglayer/source/primitive2d/helplineprimitive2d.cxx | 2 drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx | 2 drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 106 +++++----- drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx | 2 drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx | 2 drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx | 2 drawinglayer/source/primitive2d/polygonprimitive2d.cxx | 10 drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx | 16 - drawinglayer/source/primitive2d/sceneprimitive2d.cxx | 2 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx | 2 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx | 2 drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx | 2 drawinglayer/source/primitive2d/textlineprimitive2d.cxx | 2 drawinglayer/source/primitive2d/textprimitive2d.cxx | 2 drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx | 6 drawinglayer/source/primitive2d/transparenceprimitive2d.cxx | 2 drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx | 2 drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx | 2 drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx | 2 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx | 2 drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx | 2 drawinglayer/source/primitive3d/polygonprimitive3d.cxx | 4 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx | 2 drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx | 2 drawinglayer/source/primitive3d/shadowprimitive3d.cxx | 2 drawinglayer/source/primitive3d/textureprimitive3d.cxx | 8 framework/source/classes/menumanager.cxx | 8 framework/source/dispatch/menudispatcher.cxx | 6 framework/source/fwe/classes/addonmenu.cxx | 6 framework/source/fwe/classes/bmkmenu.cxx | 2 framework/source/fwe/helper/titlehelper.cxx | 2 framework/source/fwi/classes/propertysethelper.cxx | 4 framework/source/helper/statusindicator.cxx | 10 framework/source/layoutmanager/helpers.cxx | 4 framework/source/loadenv/loadenv.cxx | 6 framework/source/tabwin/tabwindow.cxx | 14 - framework/source/uiconfiguration/imagemanagerimpl.cxx | 6 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 6 framework/source/uiconfiguration/uiconfigurationmanager.cxx | 8 framework/source/uielement/controlmenucontroller.cxx | 12 - framework/source/uielement/fontmenucontroller.cxx | 6 framework/source/uielement/fontsizemenucontroller.cxx | 4 framework/source/uielement/headermenucontroller.cxx | 6 framework/source/uielement/langselectionmenucontroller.cxx | 4 framework/source/uielement/macrosmenucontroller.cxx | 4 framework/source/uielement/menubarmanager.cxx | 25 +- framework/source/uielement/newmenucontroller.cxx | 18 - framework/source/uielement/objectmenucontroller.cxx | 8 framework/source/uielement/popuptoolbarcontroller.cxx | 2 framework/source/uielement/progressbarwrapper.cxx | 8 framework/source/uielement/recentfilesmenucontroller.cxx | 4 framework/source/uielement/statusbarwrapper.cxx | 2 framework/source/uielement/statusindicatorinterfacewrapper.cxx | 10 framework/source/uielement/toolbarmanager.cxx | 8 framework/source/uielement/toolbarsmenucontroller.cxx | 16 - include/sfx2/fcontnr.hxx | 2 include/sfx2/request.hxx | 8 include/sfx2/tabdlg.hxx | 1 include/svl/itemset.hxx | 4 sfx2/inc/sorgitm.hxx | 6 sfx2/source/appl/appcfg.cxx | 50 ++-- sfx2/source/appl/appchild.cxx | 2 sfx2/source/appl/appopen.cxx | 4 sfx2/source/appl/appserv.cxx | 6 sfx2/source/appl/appuno.cxx | 104 ++++----- sfx2/source/appl/childwin.cxx | 20 - sfx2/source/appl/impldde.cxx | 2 sfx2/source/appl/linkmgr2.cxx | 2 sfx2/source/appl/module.cxx | 4 sfx2/source/appl/newhelp.cxx | 30 +- sfx2/source/appl/sfxhelp.cxx | 4 sfx2/source/appl/workwin.cxx | 30 +- sfx2/source/config/evntconf.cxx | 2 sfx2/source/control/bindings.cxx | 20 - sfx2/source/control/dispatch.cxx | 2 sfx2/source/control/minfitem.cxx | 11 - sfx2/source/control/sorgitm.cxx | 2 sfx2/source/control/statcach.cxx | 4 sfx2/source/control/unoctitm.cxx | 4 sfx2/source/dialog/backingcomp.cxx | 4 sfx2/source/dialog/dinfdlg.cxx | 54 ++--- 115 files changed, 518 insertions(+), 511 deletions(-)
New commits: commit 039b887c54fd7e8cd8a4964d1633fdfc300e938e Author: Noel Grandin <n...@peralex.com> Date: Thu Oct 2 07:36:46 2014 +0200 loplugin: cstylecast Change-Id: I4a230f45e91773fca7d537e91c9e9fb54773cf10 diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx index 99f77fb..450e838 100644 --- a/include/sfx2/fcontnr.hxx +++ b/include/sfx2/fcontnr.hxx @@ -54,7 +54,7 @@ public: virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const SAL_OVERRIDE { return new SfxRefItem( *this ); } virtual bool operator==( const SfxPoolItem& rL) const SAL_OVERRIDE - { return ((SfxRefItem&)rL).maRef == maRef; } + { return static_cast<const SfxRefItem&>(rL).maRef == maRef; } const tools::SvRef<SvRefBase>& GetValue() const { return maRef; } }; diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx index 35eb7b1..a47f962 100644 --- a/include/sfx2/request.hxx +++ b/include/sfx2/request.hxx @@ -113,11 +113,11 @@ private: #define SFX_REQUEST_ARG(rReq, pItem, ItemType, nSlotId, bDeep) \ - const ItemType *pItem = (const ItemType*) \ - rReq.GetArg( nSlotId, bDeep, TYPE(ItemType) ) + const ItemType *pItem = static_cast<const ItemType*>( \ + rReq.GetArg( nSlotId, bDeep, TYPE(ItemType) ) ) #define SFX_ITEMSET_ARG(pArgs, pItem, ItemType, nSlotId, bDeep) \ - const ItemType *pItem = (const ItemType*) \ - SfxRequest::GetItem( pArgs, nSlotId, bDeep, TYPE(ItemType) ) + const ItemType *pItem = static_cast<const ItemType*>( \ + SfxRequest::GetItem( pArgs, nSlotId, bDeep, TYPE(ItemType) ) ) #endif diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index a061793..c4f0e98 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -211,6 +211,7 @@ public: void Start( bool bShow = true ); const SfxItemSet* GetExampleSet() const { return pExampleSet; } + SfxItemSet* GetExampleSet() { return pExampleSet; } SfxViewFrame* GetViewFrame() const { return pFrame; } void SetApplyHandler(const Link& _rHdl); diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index f2598ef..418eb86 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -95,6 +95,10 @@ public: bool bSrchInParent = true, const SfxPoolItem **ppItem = 0 ) const; + SfxItemState GetItemState( sal_uInt16 nWhich, + bool bSrchInParent = true, + SfxPoolItem **ppItem = 0 ); + bool HasItem(sal_uInt16 nWhich, const SfxPoolItem** ppItem = NULL) const; virtual void DisableItem(sal_uInt16 nWhich); diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx index 494f4e6..2fd26ea 100644 --- a/sfx2/inc/sorgitm.hxx +++ b/sfx2/inc/sorgitm.hxx @@ -34,11 +34,11 @@ public: SfxScriptOrganizerItem( const SfxScriptOrganizerItem& ); virtual ~SfxScriptOrganizerItem(); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const SAL_OVERRIDE; - virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const SAL_OVERRIDE; + virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE; virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE; - OUString getLanguage() { return aLanguage; }; + OUString getLanguage() const { return aLanguage; }; }; #endif diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index a88ae48..f956a48 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -511,14 +511,14 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); sal_uInt16 nOutStyle = - ( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT; + static_cast<const SfxBoolItem *>(pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT; aMiscOptions.SetToolboxStyle( nOutStyle ); } if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), true, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - bool bBigSize = ( (const SfxBoolItem*)pItem )->GetValue(); + bool bBigSize = static_cast<const SfxBoolItem*>(pItem)->GetValue(); aMiscOptions.SetSymbolsSize( sal::static_int_cast< sal_Int16 >( bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) ); @@ -536,7 +536,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), true, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() ); + aSaveOptions.SetBackup( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); } // PrettyPrinting @@ -557,49 +557,49 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() ); + aSaveOptions.SetAutoSave( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); } // AutoSave-Propt if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetAutoSavePrompt(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // AutoSave-Time if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); - aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue()); + aSaveOptions.SetAutoSaveTime(static_cast<const SfxUInt16Item *>(pItem)->GetValue()); } // UserAutoSave if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_USERAUTOSAVE), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetUserAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() ); + aSaveOptions.SetUserAutoSave( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); } // DocInfo if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetDocInfoSave(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Mark open Documents if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveWorkingSet(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Save window settings if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveDocView(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Metric @@ -612,28 +612,28 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue()); + aHelpOptions.SetExtendedHelp(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // HelpTips if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue()); + aHelpOptions.SetHelpTips( static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // WelcomeScreen if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() ); + aHelpOptions.SetWelcomeScreen( static_cast<const SfxBoolItem *>(pItem)->GetValue() ); } // WelcomeScreen if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - bool bReset = ((const SfxBoolItem *)pItem)->GetValue(); + bool bReset = static_cast<const SfxBoolItem *>(pItem)->GetValue(); if ( bReset ) { OSL_FAIL( "Not implemented, may be EOL!" ); @@ -642,28 +642,28 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); - aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() ); + aHelpOptions.SetHelpStyleSheet( static_cast<const SfxStringItem *>(pItem)->GetValue() ); } // SaveRelINet if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveRelINet(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // SaveRelFSys if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue()); + aSaveOptions.SetSaveRelFSys(static_cast<const SfxBoolItem *>(pItem)->GetValue()); } // Undo-Count if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); - sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nUndoCount = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); officecfg::Office::Common::Undo::Steps::set(nUndoCount, batch); // To catch all Undo-Managers: Iterate over all Frames @@ -692,21 +692,21 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); - ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() ); + ShutdownIcon::SetAutostart( static_cast<const SfxBoolItem*>( pItem )->GetValue() ); } // StarBasic Enable if ( SfxItemState::SET == rSet.GetItemState(SID_BASIC_ENABLED, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected"); - aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() ); + aSecurityOptions.SetBasicMode( (EBasicSecurityMode)static_cast<const SfxUInt16Item*>( pItem )->GetValue() ); } // Execute PlugIns if ( SfxItemState::SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); - aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() ); + aSecurityOptions.SetExecutePlugins( static_cast<const SfxBoolItem *>( pItem )->GetValue() ); } if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), true, &pItem)) @@ -752,19 +752,19 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected"); ::com::sun::star::uno::Sequence< OUString > seqURLs; - ((SfxStringListItem*)pItem)->GetStringList(seqURLs); + static_cast<const SfxStringListItem*>(pItem)->GetStringList(seqURLs); aSecurityOptions.SetSecureURLs( seqURLs ); } if ( SfxItemState::SET == rSet.GetItemState(SID_MACRO_WARNING, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); - aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); + aSecurityOptions.SetWarningEnabled( static_cast<const SfxBoolItem *>(pItem)->GetValue() ); } if ( SfxItemState::SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected"); - aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() ); + aSecurityOptions.SetConfirmationEnabled( static_cast<const SfxBoolItem *>(pItem)->GetValue() ); } // Store changed data @@ -786,7 +786,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), true, &pItem)) { DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected"); - const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem; + const SfxAllEnumItem* pEnumItem = static_cast<const SfxAllEnumItem *>(pItem); sal_uInt32 nCount = pEnumItem->GetValueCount(); OUString aNoChangeStr( ' ' ); for( sal_uInt32 nPath=0; nPath<nCount; ++nPath ) diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index 43ff5f1..b2cbe57 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -138,7 +138,7 @@ SfxTemplateDialog* SfxApplication::GetTemplateDialog() if ( pAppData_Impl->pViewFrame ) { SfxChildWindow *pChild = pAppData_Impl->pViewFrame->GetChildWindow(SfxTemplateDialogWrapper::GetChildWindowId()); - return pChild ? (SfxTemplateDialog*) pChild->GetWindow() : 0; + return pChild ? static_cast<SfxTemplateDialog*>(pChild->GetWindow()) : 0; } return NULL; diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index e675f38..2b8c1ae 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -649,7 +649,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) return; } - rReq.SetArgs( *(SfxAllItemSet*)pSet ); + rReq.SetArgs( *static_cast<SfxAllItemSet*>(pSet) ); if ( !aFilter.isEmpty() ) rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) ); rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) ); @@ -959,7 +959,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // remove from Itemset, because it confuses the parameter transformation if ( pLinkItem ) - pLinkItem = (SfxLinkItem*) pLinkItem->Clone(); + pLinkItem = static_cast<SfxLinkItem*>( pLinkItem->Clone() ); rReq.RemoveItem( SID_DONELINK ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index f5624bc..274ce98 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1108,7 +1108,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) Reference< XModel > xLimitToModel; if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_RECORDMACRO, false, &pItem) ) { - bool bRecord = ((SfxBoolItem*)pItem)->GetValue(); + bool bRecord = static_cast<const SfxBoolItem*>(pItem)->GetValue(); if ( bRecord ) { // !Hack @@ -1133,7 +1133,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) sal_Int16 nTabId = 0; if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_MACROORGANIZER, false, &pItem) ) { - nTabId = ((SfxUInt16Item*)pItem)->GetValue(); + nTabId = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } SfxApplication::MacroOrganizer( nTabId ); @@ -1203,7 +1203,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) OUString aLanguage; if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_SCRIPTORGANIZER, false, &pItem) ) { - aLanguage = ((SfxScriptOrganizerItem*)pItem)->getLanguage(); + aLanguage = static_cast<const SfxScriptOrganizerItem*>(pItem)->getLanguage(); } OUString aLang( aLanguage ); diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 6cb5321..4e53652 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1380,62 +1380,62 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b if ( rSet.GetItemState( SID_COMPONENTDATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sComponentData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_COMPONENTCONTEXT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sComponentContext); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStatusInd); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_INTERACTIONHANDLER, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sInteractionHdl); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_VIEW_DATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sViewData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FILTER_DATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFilterData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOCUMENT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sModel); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_CONTENT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sUCBContent); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_INPUTSTREAM, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sInputStream); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_STREAM, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStream); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_OUTPUTSTREAM, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sOutputStream); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_POSTDATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sPostData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FILLFRAME, false, &pItem ) == SfxItemState::SET ) { @@ -1453,206 +1453,206 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b if ( rSet.GetItemState( SID_TEMPLATE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sAsTemplate); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sOpenNewView); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FAIL_ON_WARNING, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFailOnWarning); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_VIEW_ID, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sViewId); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PLUGIN_MODE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sPluginMode); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_READONLY, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sReadOnly); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDdeReconnect); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStartPresentation); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SELECTION, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSelectionOnly); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_HIDDEN, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sHidden); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_MINIMIZED, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sMinimized); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SILENT, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSilent); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PREVIEW, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sPreview); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_VIEWONLY, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sViewOnly); - pValue[nActProp++].Value <<= ((SfxBoolItem*)pItem)->GetValue() ; + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_EDITDOC, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDontEdit); - pValue[nActProp++].Value <<= !( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= !static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_FILE_DIALOG, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sUseSystemDialog); - pValue[nActProp++].Value <<= ((SfxBoolItem*)pItem)->GetValue(); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_STANDARD_DIR, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sStandardDir); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= OUString( static_cast<const SfxStringItem*>(pItem)->GetValue()); } if ( rSet.GetItemState( SID_BLACK_LIST, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sBlackList); com::sun::star::uno::Sequence< OUString > aList; - ((SfxStringListItem*)pItem)->GetStringList( aList ); + static_cast<const SfxStringListItem*>(pItem)->GetStringList( aList ); pValue[nActProp++].Value <<= aList ; } if ( rSet.GetItemState( SID_TARGETNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFrameName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= OUString( static_cast<const SfxStringItem*>(pItem)->GetValue() ); } if ( rSet.GetItemState( SID_DOC_SALVAGE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSalvagedFile); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_PATH, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sFolderName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_CONTENTTYPE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sMediaType); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_TEMPLATE_NAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sTemplateName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sTemplateRegionName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_JUMPMARK, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sJumpMark); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_CHARSET, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sCharacterSet); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_MACROEXECMODE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sMacroExecMode); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_UPDATEDOCMODE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sUpdateDocMode); - pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= (sal_Int16) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_REPAIRPACKAGE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sRepairPackage); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue() ; } if ( rSet.GetItemState( SID_DOCINFO_TITLE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDocumentTitle); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_BASEURL, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDocumentBaseURL); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sHierarchicalDocumentName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sCopyStreamIfPossible); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_NOAUTOSAVE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sNoAutoSave); - pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() ); + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue() ; } if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sModifyPasswordInfo); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_ENCRYPTIONDATA, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sEncryptionData); - pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + pValue[nActProp++].Value = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSuggestedSaveAsDir); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sSuggestedSaveAsName); - pValue[nActProp++].Value <<= ( OUString(((SfxStringItem*)pItem)->GetValue()) ); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if ( rSet.GetItemState( SID_DOC_SERVICE, false, &pItem ) == SfxItemState::SET ) { pValue[nActProp].Name = OUString(sDocumentService); - pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue()); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } if (rSet.HasItem(SID_FILTER_PROVIDER, &pItem)) { pValue[nActProp].Name = sFilterProvider; - pValue[nActProp++].Value <<= OUString(static_cast<const SfxStringItem*>(pItem)->GetValue()); + pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue(); } } diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 65d8874..e2cb968 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -322,16 +322,16 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const sal_uIntPtr nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; if ( pWindow->GetStyle() & WB_SIZEABLE ) nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); - aInfo.aWinState = ((SystemWindow*)pWindow)->GetWindowState( nMask ); + aInfo.aWinState = static_cast<SystemWindow*>(pWindow)->GetWindowState( nMask ); } else if ( pWindow->GetType() == RSC_DOCKINGWINDOW ) { - if (((DockingWindow*)pWindow)->GetFloatingWindow() ) - aInfo.aWinState = ((DockingWindow*)pWindow)->GetFloatingWindow()->GetWindowState(); + if (static_cast<DockingWindow*>(pWindow)->GetFloatingWindow() ) + aInfo.aWinState = static_cast<DockingWindow*>(pWindow)->GetFloatingWindow()->GetWindowState(); else { SfxChildWinInfo aTmpInfo; - ((SfxDockingWindow*)pWindow)->FillInfo( aTmpInfo ); + static_cast<SfxDockingWindow*>(pWindow)->FillInfo( aTmpInfo ); aInfo.aExtraString = aTmpInfo.aExtraString; } } @@ -513,11 +513,11 @@ FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const vcl::Window *pParent = pWindow->GetParent(); if (pParent->GetType() == WINDOW_DOCKINGWINDOW || pParent->GetType() == WINDOW_TOOLBOX) { - return ((DockingWindow*)pParent)->GetFloatingWindow(); + return static_cast<DockingWindow*>(pParent)->GetFloatingWindow(); } else if (pParent->GetType() == WINDOW_FLOATINGWINDOW) { - return (FloatingWindow*) pParent; + return static_cast<FloatingWindow*>(pParent); } else { @@ -646,10 +646,10 @@ void SfxChildWindow::Hide() switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pWindow)->Hide(); + static_cast<DockingWindow*>(pWindow)->Hide(); break; case RSC_TOOLBOX : - ((ToolBox*)pWindow)->Hide(); + static_cast<ToolBox*>(pWindow)->Hide(); break; default: pWindow->Hide(); @@ -662,10 +662,10 @@ void SfxChildWindow::Show( sal_uInt16 nFlags ) switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pWindow)->Show( true, nFlags ); + static_cast<DockingWindow*>(pWindow)->Show( true, nFlags ); break; case RSC_TOOLBOX : - ((ToolBox*)pWindow)->Show( true, nFlags ); + static_cast<ToolBox*>(pWindow)->Show( true, nFlags ); break; default: pWindow->Show( true, nFlags ); diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 8da6934..526a839 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -349,7 +349,7 @@ IMPL_LINK( SvDDEObject, ImplGetDDEData, DdeData*, pData ) IMPL_LINK( SvDDEObject, ImplDoneDDEData, void*, pData ) { - bool bValid = (bool)(sal_uIntPtr)pData; + bool bValid = (bool)reinterpret_cast<sal_uIntPtr>(pData); if( !bValid && ( pRequest || pLink )) { DdeTransaction* pReq = 0; diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 43673a0..314cd81 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -493,7 +493,7 @@ void LinkManager::CancelTransfers() for( size_t n = rLnks.size(); n; ) if( 0 != ( pLnk = &(*rLnks[ --n ])) && OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) && - 0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) ) + 0 != ( pFileObj = static_cast<SvFileObject*>(pLnk->GetObj()) ) ) pFileObj->CancelTransfers(); } // For the purpose of sending Status information from the file object to diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index e1c4382..5d4fdbc 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -381,7 +381,7 @@ FieldUnit SfxModule::GetCurrentFieldUnit() { const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); if ( pItem ) - eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); + eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); } else SAL_WARN( "sfx.appl", "GetModuleFieldUnit(): no module found" ); @@ -393,7 +393,7 @@ FieldUnit SfxModule::GetFieldUnit() const FieldUnit eUnit = FUNIT_INCH; const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC ); if ( pItem ) - eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); + eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); return eUnit; } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 7df7d96..66555ec 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -471,7 +471,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeIndexBox(vcl::Window * void IndexBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) { - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( rUDEvt.GetItemId() ); + IndexEntry_Impl* pEntry = reinterpret_cast<IndexEntry_Impl*>(GetEntryData( rUDEvt.GetItemId() )); if ( pEntry && pEntry->m_bSubEntry ) { // indent sub entries @@ -510,11 +510,11 @@ void IndexBox_Impl::SelectExecutableEntry() { sal_Int32 nOldPos = nPos; OUString aEntryText; - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( nPos ); + IndexEntry_Impl* pEntry = reinterpret_cast<IndexEntry_Impl*>(GetEntryData( nPos )); sal_Int32 nCount = GetEntryCount(); while ( nPos < nCount && ( !pEntry || pEntry->m_aURL.isEmpty() ) ) { - pEntry = (IndexEntry_Impl*)(sal_uIntPtr)GetEntryData( ++nPos ); + pEntry = reinterpret_cast<IndexEntry_Impl*>(GetEntryData( ++nPos )); aEntryText = GetEntry( nPos ); } @@ -557,7 +557,7 @@ namespace sfx2 { } #define NEW_ENTRY( url, bool ) \ - (void*)(sal_uIntPtr)( new IndexEntry_Impl( url, bool ) ) + reinterpret_cast<void*>( new IndexEntry_Impl( url, bool ) ) #define UNIFY_AND_INSERT_TOKEN( aToken ) \ it = aInfo.insert( sfx2::KeywordInfo::value_type( aToken, 0 ) ).first; \ @@ -699,7 +699,7 @@ void IndexTabPage_Impl::ClearIndex() { sal_uInt16 nCount = m_pIndexCB->GetEntryCount(); for ( sal_uInt16 i = 0; i < nCount; ++i ) - delete (IndexEntry_Impl*)(sal_uIntPtr)m_pIndexCB->GetEntryData(i); + delete reinterpret_cast<IndexEntry_Impl*>(m_pIndexCB->GetEntryData(i)); m_pIndexCB->Clear(); } @@ -766,7 +766,7 @@ void IndexTabPage_Impl::SetFactory( const OUString& rFactory ) OUString IndexTabPage_Impl::GetSelectEntry() const { OUString aRet; - IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)m_pIndexCB->GetEntryData( m_pIndexCB->GetEntryPos( m_pIndexCB->GetText() ) ); + IndexEntry_Impl* pEntry = reinterpret_cast<IndexEntry_Impl*>(m_pIndexCB->GetEntryData( m_pIndexCB->GetEntryPos( m_pIndexCB->GetText() ) )); if ( pEntry ) aRet = pEntry->m_aURL; return aRet; @@ -972,7 +972,7 @@ void SearchTabPage_Impl::ClearSearchResults() { sal_uInt16 nCount = m_pResultsLB->GetEntryCount(); for ( sal_uInt16 i = 0; i < nCount; ++i ) - delete (OUString*)(sal_uIntPtr)m_pResultsLB->GetEntryData(i); + delete reinterpret_cast<OUString*>(m_pResultsLB->GetEntryData(i)); m_pResultsLB->Clear(); m_pResultsLB->Update(); } @@ -1068,7 +1068,7 @@ void SearchTabPage_Impl::SetDoubleClickHdl( const Link& rLink ) OUString SearchTabPage_Impl::GetSelectEntry() const { OUString aRet; - OUString* pData = (OUString*)(sal_uIntPtr)m_pResultsLB->GetEntryData( m_pResultsLB->GetSelectEntryPos() ); + OUString* pData = reinterpret_cast<OUString*>(m_pResultsLB->GetEntryData( m_pResultsLB->GetSelectEntryPos() )); if ( pData ) aRet = *pData; return aRet; @@ -1146,7 +1146,7 @@ BookmarksBox_Impl::~BookmarksBox_Impl() for ( sal_uInt16 i = 0; i < nCount; ++i ) { OUString aTitle = GetEntry(i); - OUString* pURL = (OUString*)(sal_uIntPtr)GetEntryData(i); + OUString* pURL = reinterpret_cast<OUString*>(GetEntryData(i)); aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, sEmpty, aTitle, sEmpty, sEmpty); delete pURL; } @@ -1171,7 +1171,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction ) aDlg.SetTitle( GetEntry( nPos ) ); if ( aDlg.Execute() == RET_OK ) { - OUString* pURL = (OUString*)(sal_uIntPtr)GetEntryData( nPos ); + OUString* pURL = reinterpret_cast<OUString*>(GetEntryData( nPos )); RemoveEntry( nPos ); OUString aImageURL = IMAGE_URL; aImageURL += INetURLObject( *pURL ).GetHost(); @@ -1295,7 +1295,7 @@ void BookmarksTabPage_Impl::SetDoubleClickHdl( const Link& rLink ) OUString BookmarksTabPage_Impl::GetSelectEntry() const { OUString aRet; - OUString* pData = (OUString*)(sal_uIntPtr)m_pBookmarksBox->GetEntryData(m_pBookmarksBox->GetSelectEntryPos()); + OUString* pData = reinterpret_cast<OUString*>(m_pBookmarksBox->GetEntryData(m_pBookmarksBox->GetSelectEntryPos())); if ( pData ) aRet = *pData; return aRet; @@ -1421,7 +1421,7 @@ SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl() DELETEZ( pBPage ); for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i ) - delete (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData(i); + delete reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData(i)); SvtViewOptions aViewOpt( E_TABDIALOG, CONFIGNAME_INDEXWIN ); aViewOpt.SetPageID( (sal_Int32)m_pTabCtrl->GetCurPageId() ); @@ -1464,7 +1464,7 @@ void SfxHelpIndexWindow_Impl::SetActiveFactory() for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i ) { - OUString* pFactory = (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData(i); + OUString* pFactory = reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData(i)); *pFactory = pFactory->toAsciiLowerCase(); if ( *pFactory == pIPage->GetFactory() ) { @@ -1537,7 +1537,7 @@ IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, InitHdl) IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, SelectFactoryHdl) { - OUString* pFactory = (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData( m_pActiveLB->GetSelectEntryPos() ); + OUString* pFactory = reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData( m_pActiveLB->GetSelectEntryPos() )); if ( pFactory ) { SetFactory( OUString( *pFactory ).toAsciiLowerCase(), false ); @@ -1720,7 +1720,7 @@ bool SfxHelpIndexWindow_Impl::IsValidFactory( const OUString& _rFactory ) bool bValid = false; for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i ) { - OUString* pFactory = (OUString*)(sal_uIntPtr)m_pActiveLB->GetEntryData(i); + OUString* pFactory = reinterpret_cast<OUString*>(m_pActiveLB->GetEntryData(i)); if ( *pFactory == _rFactory ) { bValid = true; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index fa14e7d..e9cab42 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -587,7 +587,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const //see if it has a TabControl and ask the active tab of //that for help bTriedTabPage = true; - Dialog *pDialog = ((Dialog*)pParent); + Dialog *pDialog = static_cast<Dialog*>(pParent); TabControl *pCtrl = pDialog->hasBuilder() ? pDialog->get<TabControl>("tabcontrol") : NULL; TabPage* pTabPage = pCtrl ? pCtrl->GetTabPage(pCtrl->GetCurPageId()) : NULL; vcl::Window *pTabChild = pTabPage ? pTabPage->GetWindow(WINDOW_FIRSTCHILD) : NULL; @@ -627,7 +627,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const if (!xHelp.is()) pHelpWindow = impl_createHelp(xHelp, xHelpContent); else - pHelpWindow = (SfxHelpWindow_Impl*)VCLUnoHelper::GetWindow(xHelp->getComponentWindow()); + pHelpWindow = static_cast<SfxHelpWindow_Impl*>(VCLUnoHelper::GetWindow(xHelp->getComponentWindow())); if (!xHelp.is() || !xHelpContent.is() || !pHelpWindow) return false; diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 332c32b..69b5f8e 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -852,7 +852,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_LOWESTTOP: aSize.Width() = aTmp.GetWidth(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); bAllowHiding = false; aBorder.Top() += aSize.Height(); aPos = aTmp.TopLeft(); @@ -867,7 +867,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_HIGHESTBOTTOM: aSize.Width() = aTmp.GetWidth(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); aBorder.Bottom() += aSize.Height(); aPos = aTmp.BottomLeft(); aPos.Y() -= (aSize.Height()-1); @@ -882,7 +882,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_TOOLBOXLEFT: aSize.Height() = aTmp.GetHeight(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); bAllowHiding = false; aBorder.Left() += aSize.Width(); aPos = aTmp.TopLeft(); @@ -897,7 +897,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() case SFX_ALIGN_TOOLBOXRIGHT: aSize.Height() = aTmp.GetHeight(); if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW ) - aSize = ((SplitWindow *)(pCli->pWin))->CalcLayoutSizePixel( aSize ); + aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize ); aBorder.Right() += aSize.Width(); aPos = aTmp.TopRight(); aPos.X() -= (aSize.Width()-1); @@ -1071,10 +1071,10 @@ void SfxWorkWindow::ShowChildren_Impl() switch ( pCli->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pCli->pWin)->Show( true, nFlags ); + static_cast<DockingWindow*>(pCli->pWin)->Show( true, nFlags ); break; case RSC_SPLITWINDOW : - ((SplitWindow*)pCli->pWin)->Show( true, nFlags ); + static_cast<SplitWindow*>(pCli->pWin)->Show( true, nFlags ); break; default: pCli->pWin->Show( true, nFlags ); @@ -1088,7 +1088,7 @@ void SfxWorkWindow::ShowChildren_Impl() switch ( pCli->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pCli->pWin)->Hide(); + static_cast<DockingWindow*>(pCli->pWin)->Hide(); break; default: pCli->pWin->Hide(); @@ -1111,7 +1111,7 @@ void SfxWorkWindow::HideChildren_Impl() switch ( pChild->pWin->GetType() ) { case RSC_DOCKINGWINDOW : - ((DockingWindow*)pChild->pWin)->Hide(); + static_cast<DockingWindow*>(pChild->pWin)->Hide(); break; default: pChild->pWin->Hide(); @@ -1485,7 +1485,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() { if ( pCW->bCreate && IsDockingAllowed() && bInternalDockingAllowed ) // The window ia within a SplitWindow - ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Reappear_Impl(); } if ( pCW->nInterfaceId != pChildWin->GetContextId() ) @@ -1505,7 +1505,7 @@ void SfxWorkWindow::UpdateChildWindows_Impl() pCW->pCli->nVisible ^= CHILD_NOT_HIDDEN; } else - ((SfxDockingWindow*)pChildWin->GetWindow())->Disappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Disappear_Impl(); } else RemoveChildWin_Impl( pCW ); @@ -1715,7 +1715,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, { if ( pChild->GetWindow()->GetType() == RSC_DOCKINGWINDOW ) // it's a DockingWindow - pDockWin = (SfxDockingWindow*) pChild->GetWindow(); + pDockWin = static_cast<SfxDockingWindow*>( pChild->GetWindow() ); else // FloatingWindow or ModelessDialog pWin = pChild->GetWindow(); @@ -1751,7 +1751,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, pWin = pSplitWin->GetSplitWindow(); if ( pSplitWin->GetWindowCount() == 1 ) - ((SplitWindow*)pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + static_cast<SplitWindow*>(pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } } @@ -2063,7 +2063,7 @@ void SfxWorkWindow::ToggleChildWindow_Impl(sal_uInt16 nId, bool bSetFocus) if ( !pCW->pCli ) { SfxDockingWindow *pDock = - (SfxDockingWindow*) pCW->pWin->GetWindow(); + static_cast<SfxDockingWindow*>( pCW->pWin->GetWindow() ); if ( pDock->IsAutoHide_Impl() ) pDock->AutoShow_Impl(); } @@ -2279,7 +2279,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe pChildWin->Show( bSetFocus && pChildWin->WantsFocus() ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } else - ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Reappear_Impl(); } else @@ -2290,7 +2290,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe pCW->pWin->Hide(); } else - ((SfxDockingWindow*)pChildWin->GetWindow())->Disappear_Impl(); + static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Disappear_Impl(); } diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index 33dfd04..e84f772 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -77,7 +77,7 @@ bool SfxEventNamesItem::operator==( const SfxPoolItem& rAttr ) const DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); const SfxEventNamesList& rOwn = aEventsList; - const SfxEventNamesList& rOther = ( (SfxEventNamesItem&) rAttr ).aEventsList; + const SfxEventNamesList& rOther = static_cast<const SfxEventNamesItem&>( rAttr ).aEventsList; if ( rOwn.size() != rOther.size() ) return false; diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index ea6a329..33e49cd 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1151,19 +1151,19 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell if ( pOldItem->ISA(SfxBoolItem) ) { // we can toggle Bools - bool bOldValue = ((const SfxBoolItem *)pOldItem)->GetValue(); - SfxBoolItem *pNewItem = (SfxBoolItem*) (pOldItem->Clone()); + bool bOldValue = static_cast<const SfxBoolItem *>(pOldItem)->GetValue(); + SfxBoolItem *pNewItem = static_cast<SfxBoolItem*>(pOldItem->Clone()); pNewItem->SetValue( !bOldValue ); aReq.AppendItem( *pNewItem ); delete pNewItem; } else if ( pOldItem->ISA(SfxEnumItemInterface) && - ((SfxEnumItemInterface *)pOldItem)->HasBoolValue()) + static_cast<const SfxEnumItemInterface *>(pOldItem)->HasBoolValue()) { // and Enums with Bool-Interface SfxEnumItemInterface *pNewItem = - (SfxEnumItemInterface*) (pOldItem->Clone()); - pNewItem->SetBoolValue(!((SfxEnumItemInterface *)pOldItem)->GetBoolValue()); + static_cast<SfxEnumItemInterface*>(pOldItem->Clone()); + pNewItem->SetBoolValue(!static_cast<const SfxEnumItemInterface *>(pOldItem)->GetBoolValue()); aReq.AppendItem( *pNewItem ); delete pNewItem; } @@ -1181,14 +1181,14 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell if ( pNewItem->ISA(SfxBoolItem) ) { // we can toggle Bools - ((SfxBoolItem*)pNewItem)->SetValue( true ); + static_cast<SfxBoolItem*>(pNewItem)->SetValue( true ); aReq.AppendItem( *pNewItem ); } else if ( pNewItem->ISA(SfxEnumItemInterface) && - ((SfxEnumItemInterface *)pNewItem)->HasBoolValue()) + static_cast<SfxEnumItemInterface *>(pNewItem)->HasBoolValue()) { // and Enums with Bool-Interface - ((SfxEnumItemInterface*)pNewItem)->SetBoolValue(true); + static_cast<SfxEnumItemInterface*>(pNewItem)->SetBoolValue(true); aReq.AppendItem( *pNewItem ); } else { @@ -1395,7 +1395,7 @@ void SfxBindings::UpdateControllers_Impl if ( SfxItemState::DONTCARE == eState ) { // ambiguous - pCache->SetState( SfxItemState::DONTCARE, (SfxPoolItem *)-1 ); + pCache->SetState( SfxItemState::DONTCARE, reinterpret_cast<SfxPoolItem *>(-1) ); } else if ( SfxItemState::DEFAULT == eState && rFound.nWhichId > SFX_WHICH_MAX ) @@ -1466,7 +1466,7 @@ void SfxBindings::UpdateControllers_Impl else { // ambiguous - pEnumCache->SetState( SfxItemState::DONTCARE, (SfxPoolItem *)-1 ); + pEnumCache->SetState( SfxItemState::DONTCARE, reinterpret_cast<SfxPoolItem *>(-1) ); } } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index f7da5d2..a1b2ea0 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -2188,7 +2188,7 @@ SfxModule* SfxDispatcher::GetModule() const if ( pSh == NULL ) return 0; if ( pSh->ISA(SfxModule) ) - return (SfxModule*) pSh; + return static_cast<SfxModule*>(pSh); } } diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index be60afb..8fd6537 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -61,12 +61,13 @@ SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy): bool SfxMacroInfoItem::operator==( const SfxPoolItem& rCmp) const { + const SfxMacroInfoItem rItem = static_cast<const SfxMacroInfoItem&>(rCmp); return SfxPoolItem::operator==(rCmp) && - pBasicManager == ((const SfxMacroInfoItem&)rCmp).pBasicManager && - aLibName == ((const SfxMacroInfoItem&)rCmp).aLibName && - aModuleName == ((const SfxMacroInfoItem&)rCmp).aModuleName && - aMethodName == ((const SfxMacroInfoItem&)rCmp).aMethodName && - aCommentText == ((const SfxMacroInfoItem&)rCmp).aCommentText; + pBasicManager == rItem.pBasicManager && + aLibName == rItem.aLibName && + aModuleName == rItem.aModuleName && + aMethodName == rItem.aMethodName && + aCommentText == rItem.aCommentText; } diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx index 0a4b83ef..0782951 100644 --- a/sfx2/source/control/sorgitm.cxx +++ b/sfx2/source/control/sorgitm.cxx @@ -63,7 +63,7 @@ bool SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const { return rItem.Type() == Type() && SfxStringItem::operator==(rItem) && - aLanguage == ((const SfxScriptOrganizerItem &)rItem).aLanguage; + aLanguage == static_cast<const SfxScriptOrganizerItem &>(rItem).aLanguage; } diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index 61d65b4..b744422 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -430,7 +430,7 @@ void SfxStateCache::SetState_Impl } if ( pInternalController ) - ((SfxDispatchController_Impl *)pInternalController)->StateChanged( nId, eState, pState, &aSlotServ ); + static_cast<SfxDispatchController_Impl *>(pInternalController)->StateChanged( nId, eState, pState, &aSlotServ ); // Remember new value if ( !IsInvalidItem(pLastItem) ) @@ -469,7 +469,7 @@ void SfxStateCache::SetCachedState( bool bAlways ) } if ( pInternalController ) - ((SfxDispatchController_Impl *)pInternalController)->StateChanged( nId, eLastState, pLastItem, &aSlotServ ); + static_cast<SfxDispatchController_Impl *>(pInternalController)->StateChanged( nId, eLastState, pLastItem, &aSlotServ ); // Controller is now ok bCtrlDirty = true; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 9086313..57416d7 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -863,7 +863,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt bVisible = true; } else - bVisible = ((SfxVisibilityItem *)pState)->GetValue(); + bVisible = static_cast<const SfxVisibilityItem *>(pState)->GetValue(); } else { @@ -919,7 +919,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt { try { - ((::com::sun::star::frame::XStatusListener *)aIt.next())->statusChanged( aEvent ); + static_cast<::com::sun::star::frame::XStatusListener *>(aIt.next())->statusChanged( aEvent ); } catch (const ::com::sun::star::uno::RuntimeException&) { diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 8f5f7d7..39845ca 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -402,7 +402,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f // initialize the component and its parent window css::uno::Reference< css::awt::XWindow > xParentWindow = xFrame->getContainerWindow(); - WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow); + WorkWindow* pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow)); vcl::Window* pWindow = VCLUnoHelper::GetWindow(m_xWindow); // disable full screen mode of the frame! @@ -799,7 +799,7 @@ void SAL_CALL BackingComp::dispatch( const css::util::URL& aURL, const css::uno: // Recalculate minimum width css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow(); - WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow); + WorkWindow* pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow)); if( pParent ) { pParent->SetMinOutputSizePixel( Size( diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ccbf913..46723e3 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -658,7 +658,7 @@ bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet) if ( pExSet && SfxItemState::SET != pExSet->GetItemState( SID_DOCINFO, true, &pItem ) ) pInfo = m_pInfoItem; else if ( pItem ) - pInfo = new SfxDocumentInfoItem( *(const SfxDocumentInfoItem *)pItem ); + pInfo = new SfxDocumentInfoItem( *static_cast<const SfxDocumentInfoItem *>(pItem) ); if ( !pInfo ) { @@ -694,7 +694,7 @@ bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet) void SfxDocumentDescPage::Reset(const SfxItemSet *rSet) { - m_pInfoItem = &(SfxDocumentInfoItem &)rSet->Get(SID_DOCINFO); + m_pInfoItem = const_cast<SfxDocumentInfoItem*>(&static_cast<const SfxDocumentInfoItem &>(rSet->Get(SID_DOCINFO))); m_pTitleEd->SetText( m_pInfoItem->getTitle() ); m_pThemaEd->SetText( m_pInfoItem->getSubject() ); @@ -933,12 +933,12 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet ) m_pUseUserDataCB->IsValueChangedFromSaved() && GetTabDialog() && GetTabDialog()->GetExampleSet() ) { - const SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); - const SfxPoolItem* pItem; + SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); + SfxPoolItem* pItem; if ( pExpSet && SfxItemState::SET == pExpSet->GetItemState( SID_DOCINFO, true, &pItem ) ) { - SfxDocumentInfoItem* m_pInfoItem = (SfxDocumentInfoItem*)pItem; + SfxDocumentInfoItem* m_pInfoItem = static_cast<SfxDocumentInfoItem*>(pItem); bool bUseData = ( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); m_pInfoItem->SetUseUserData( bUseData ); rSet->Put( SfxDocumentInfoItem( *m_pInfoItem ) ); @@ -948,17 +948,17 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet ) if ( bHandleDelete ) { - const SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); - const SfxPoolItem* pItem; + SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet(); + SfxPoolItem* pItem; if ( pExpSet && SfxItemState::SET == pExpSet->GetItemState( SID_DOCINFO, true, &pItem ) ) { - SfxDocumentInfoItem* m_pInfoItem = (SfxDocumentInfoItem*)pItem; + SfxDocumentInfoItem* pInfoItem = static_cast<SfxDocumentInfoItem*>(pItem); bool bUseAuthor = bEnableUseUserData && m_pUseUserDataCB->IsChecked(); - SfxDocumentInfoItem newItem( *m_pInfoItem ); + SfxDocumentInfoItem newItem( *pInfoItem ); newItem.resetUserData( bUseAuthor ? SvtUserOptions().GetFullName() : OUString() ); - m_pInfoItem->SetUseUserData( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); + pInfoItem->SetUseUserData( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); newItem.SetUseUserData( TRISTATE_TRUE == m_pUseUserDataCB->GetState() ); newItem.SetDeleteUserData( true ); @@ -1033,7 +1033,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) || !pItem ) m_pReadOnlyCB->Hide(); else - m_pReadOnlyCB->Check( ( (SfxBoolItem*)pItem )->GetValue() ); + m_pReadOnlyCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() ); // determine context symbol INetURLObject aURL; @@ -1197,7 +1197,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( vcl::Window* pParent, { DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentInfoDialog:<SfxStringItem> expected" ); - aTitle += ( ( SfxStringItem* ) pItem )->GetValue(); + aTitle += static_cast<const SfxStringItem*>(pItem)->GetValue(); } SetText( aTitle ); @@ -1461,7 +1461,7 @@ CustomPropertiesWindow::~CustomPropertiesWindow() IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox ) { - sal_Int64 nType = sal_Int64( (sal_IntPtr)pBox->GetEntryData( pBox->GetSelectEntryPos() ) ); + long nType = reinterpret_cast<long>( pBox->GetEntryData( pBox->GetSelectEntryPos() ) ); CustomPropertyLine* pLine = pBox->GetLine(); pLine->m_aValueEdit.Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) ); pLine->m_aDateField.Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) ); @@ -1566,8 +1566,8 @@ bool CustomPropertiesWindow::IsLineValid( CustomPropertyLine* pLine ) const { bool bIsValid = true; pLine->m_bTypeLostFocus = false; - sal_Int64 nType = sal_Int64( - (sal_IntPtr)pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); + long nType = reinterpret_cast<long>( + pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); OUString sValue = pLine->m_aValueEdit.GetText(); if ( sValue.isEmpty() ) return true; @@ -1602,7 +1602,7 @@ void CustomPropertiesWindow::ValidateLine( CustomPropertyLine* pLine, bool bIsFr pLine->m_bTypeLostFocus = true; vcl::Window* pParent = GetParent()->GetParent(); if (MessageDialog(pParent, SfxResId(STR_SFX_QUERY_WRONG_TYPE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL).Execute() == RET_OK) - pLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( (void*)CUSTOM_TYPE_TEXT ) ); + pLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( reinterpret_cast<void*>(CUSTOM_TYPE_TEXT) ) ); else pLine->m_aValueEdit.GrabFocus(); } @@ -1840,7 +1840,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny ) else pNewLine->m_aYesNoButton.CheckNo(); } - pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( (void*)nType ) ); + pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( reinterpret_cast<void*>(nType) ) ); } TypeHdl( &pNewLine->m_aTypeBox ); @@ -1919,8 +1919,8 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c if ( !sPropertyName.isEmpty() ) { aPropertiesSeq[i].Name = sPropertyName; - sal_Int64 nType = sal_Int64( - (sal_IntPtr)pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); + long nType = reinterpret_cast<long>( + pLine->m_aTypeBox.GetEntryData( pLine->m_aTypeBox.GetSelectEntryPos() ) ); if ( CUSTOM_TYPE_NUMBER == nType ) { double nValue = 0; @@ -2131,11 +2131,11 @@ bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet ) { if ( SfxItemState::SET != GetTabDialog()->GetExampleSet()->GetItemState( SID_DOCINFO, true, &pItem ) ) - pInfo = &( SfxDocumentInfoItem& )rSet->Get( SID_DOCINFO ); + pInfo = const_cast<SfxDocumentInfoItem*>(&static_cast<const SfxDocumentInfoItem& >(rSet->Get( SID_DOCINFO ))); else { bMustDelete = true; - pInfo = new SfxDocumentInfoItem( *( const SfxDocumentInfoItem* ) pItem ); + pInfo = new SfxDocumentInfoItem( *static_cast<const SfxDocumentInfoItem*>(pItem) ); } } @@ -2174,8 +2174,8 @@ bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet ) void SfxCustomPropertiesPage::Reset( const SfxItemSet* rItemSet ) { m_pPropertiesCtrl->ClearAllLines(); - const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet->Get(SID_DOCINFO); - std::vector< CustomProperty* > aCustomProps = m_pInfoItem->GetCustomProperties(); + const SfxDocumentInfoItem& rInfoItem = static_cast<const SfxDocumentInfoItem &>(rItemSet->Get(SID_DOCINFO)); + std::vector< CustomProperty* > aCustomProps = rInfoItem.GetCustomProperties(); for ( sal_uInt32 i = 0; i < aCustomProps.size(); i++ ) { m_pPropertiesCtrl->AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false ); @@ -2603,11 +2603,11 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet ) { if ( SfxItemState::SET != GetTabDialog()->GetExampleSet()->GetItemState( SID_DOCINFO, true, &pItem ) ) - pInfo = &( SfxDocumentInfoItem& )rSet->Get( SID_DOCINFO ); + pInfo = const_cast<SfxDocumentInfoItem*>(&static_cast<const SfxDocumentInfoItem& >(rSet->Get( SID_DOCINFO ))); else { bMustDelete = true; - pInfo = new SfxDocumentInfoItem( *( const SfxDocumentInfoItem* ) pItem ); + pInfo = new SfxDocumentInfoItem( *static_cast<const SfxDocumentInfoItem*>(pItem) ); } } @@ -2665,8 +2665,8 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet ) void SfxCmisPropertiesPage::Reset( const SfxItemSet* rItemSet ) { m_pPropertiesCtrl.ClearAllLines(); - const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet->Get(SID_DOCINFO); - uno::Sequence< document::CmisProperty > aCmisProps = m_pInfoItem->GetCmisProperties(); + const SfxDocumentInfoItem& rInfoItem = static_cast<const SfxDocumentInfoItem& >(rItemSet->Get(SID_DOCINFO)); + uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties(); for ( sal_Int32 i = 0; i < aCmisProps.getLength(); i++ ) { m_pPropertiesCtrl.AddLine( aCmisProps[i].Id, commit 059f5a95b245252d72ea0930668bb222103dbd14 Author: Noel Grandin <n...@peralex.com> Date: Wed Oct 1 16:01:34 2014 +0200 loplugin: cstylecast Change-Id: Ic7c9c978baf5602a508aff5976220a02ed03a680 diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index b7b6fdc..3718e16 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -213,8 +213,8 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any if( pParentParent ) { // Own basic must be document library - xAppStandardBasic = (StarBASIC*)pParentParent; - xDocStandardBasic = (StarBASIC*)pParent; + xAppStandardBasic = static_cast<StarBASIC*>(pParentParent); + xDocStandardBasic = static_cast<StarBASIC*>(pParent); } else if( pParent ) { @@ -222,13 +222,13 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any if( aName.equalsAscii("Standard") ) { // Own basic is doc standard lib - xDocStandardBasic = (StarBASIC*)p; + xDocStandardBasic = static_cast<StarBASIC*>(p); } - xAppStandardBasic = (StarBASIC*)pParent; + xAppStandardBasic = static_cast<StarBASIC*>(pParent); } else { - xAppStandardBasic = (StarBASIC*)p; + xAppStandardBasic = static_cast<StarBASIC*>(p); } bool bSearchLib = true; @@ -331,7 +331,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog SbxVariable* pDlgLibContVar = pBasic->Find(OUString("DialogLibraries"), SbxCLASS_OBJECT); if( pDlgLibContVar && pDlgLibContVar->ISA(SbUnoObject) ) { - SbUnoObject* pDlgLibContUnoObj = (SbUnoObject*)(SbxBase*)pDlgLibContVar; + SbUnoObject* pDlgLibContUnoObj = static_cast<SbUnoObject*>((SbxBase*)pDlgLibContVar); Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny(); Reference< XLibraryContainer > xDlgLibContNameAccess( aDlgLibContAny, UNO_QUERY ); @@ -379,7 +379,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog { css::uno::Reference< css::container::XNameContainer > aDlgLib; // Find dialog library for dialog, direct access is not possible here - StarBASIC* pStartedBasic = (StarBASIC*)pBasic; + StarBASIC* pStartedBasic = static_cast<StarBASIC*>(pBasic); SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : NULL; SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : NULL; @@ -400,13 +400,13 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog aDlgLib = implFindDialogLibForDialog( aAnyISP, pSearchBasic1 ); if ( aDlgLib.is() ) - pFoundBasic = (StarBASIC*)pSearchBasic1; + pFoundBasic = static_cast<StarBASIC*>(pSearchBasic1); else if( pSearchBasic2 ) { aDlgLib = implFindDialogLibForDialog( aAnyISP, pSearchBasic2 ); if ( aDlgLib.is() ) - pFoundBasic = (StarBASIC*)pSearchBasic2; + pFoundBasic = static_cast<StarBASIC*>(pSearchBasic2); } } return aDlgLib; @@ -433,7 +433,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - SbUnoObject* pUnoObj = (SbUnoObject*)(SbxBase*)pObj; + SbUnoObject* pUnoObj = static_cast<SbUnoObject*>((SbxBase*)pObj); Any aAnyISP = pUnoObj->getUnoAny(); TypeClass eType = aAnyISP.getValueType().getTypeClass(); diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index d4be5e7..7a15cce 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -487,7 +487,7 @@ OUString SbiImage::GetString( short nId ) const const SbxObject* SbiImage::FindType (const OUString& aTypeName) const { - return rTypes.Is() ? (SbxObject*)rTypes->Find(aTypeName,SbxCLASS_OBJECT) : NULL; + return rTypes.Is() ? static_cast<SbxObject*>(rTypes->Find(aTypeName,SbxCLASS_OBJECT)) : NULL; } sal_uInt16 SbiImage::CalcLegacyOffset( sal_Int32 nOffset ) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index eed53e7..bfcde23 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -239,7 +239,7 @@ SbxObject* StarBASIC::getVBAGlobals( ) } } const OUString aVBAHook("VBAGlobals"); - pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE ); + pVBAGlobals = static_cast<SbUnoObject*>(Find( aVBAHook , SbxCLASS_DONTCARE )); } return pVBAGlobals; } @@ -895,7 +895,7 @@ SbxObject* SbClassFactory::CreateObject( const OUString& rClassName ) SbxObject* pRet = NULL; if( pVar ) { - SbModule* pVarMod = (SbModule*)pVar; + SbModule* pVarMod = static_cast<SbModule*>(pVar); pRet = new SbClassModuleObject( pVarMod ); } return pRet; @@ -904,7 +904,7 @@ SbxObject* SbClassFactory::CreateObject( const OUString& rClassName ) SbModule* SbClassFactory::FindClass( const OUString& rClassName ) { SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE ); - SbModule* pMod = pVar ? (SbModule*)pVar : NULL; + SbModule* pMod = pVar ? static_cast<SbModule*>(pVar) : NULL; return pMod; } @@ -1026,7 +1026,7 @@ void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ) { for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { - SbModule* p = (SbModule*)pModules->Get( i ); + SbModule* p = static_cast<SbModule*>(pModules->Get( i )); p->ClearVarsDependingOnDeletedBasic( pDeletedBasic ); } } @@ -1143,7 +1143,7 @@ SbModule* StarBASIC::FindModule( const OUString& rName ) { for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { - SbModule* p = (SbModule*) pModules->Get( i ); + SbModule* p = static_cast<SbModule*>( pModules->Get( i ) ); if( p->GetName().equalsIgnoreAsciiCase( rName ) ) { return p; @@ -1226,7 +1226,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // Init own modules for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { - SbModule* pModule = (SbModule*)pModules->Get( nMod ); + SbModule* pModule = static_cast<SbModule*>( pModules->Get( nMod ) ); if( !pModule->IsCompiled() ) { pModule->Compile(); @@ -1241,7 +1241,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) ModuleInitDependencyMap aMIDMap; for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { - SbModule* pModule = (SbModule*)pModules->Get( nMod ); + SbModule* pModule = static_cast<SbModule*>(pModules->Get( nMod )); OUString aModuleName = pModule->GetName(); if( pModule->isProxyModule() ) { @@ -1259,7 +1259,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // Call RunInit on standard modules for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { - SbModule* pModule = (SbModule*)pModules->Get( nMod ); + SbModule* pModule = static_cast<SbModule*>(pModules->Get( nMod )); if( !pModule->isProxyModule() ) { pModule->RunInit(); @@ -1286,7 +1286,7 @@ void StarBASIC::DeInitAllModules( void ) // Deinit own modules for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { - SbModule* pModule = (SbModule*)pModules->Get( nMod ); + SbModule* pModule = static_cast<SbModule*>(pModules->Get( nMod )); if( pModule->pImage && !pModule->isProxyModule() && !pModule->ISA(SbObjModule) ) { pModule->pImage->bInit = false; @@ -1327,7 +1327,7 @@ SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t ) } if( !pRes ) { - pRes = ((SbiStdObject*) (SbxObject*) pRtl)->Find( rName, t ); + pRes = static_cast<SbiStdObject*>((SbxObject*) pRtl)->Find( rName, t ); } if( pRes ) { @@ -1339,7 +1339,7 @@ SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t ) { for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { - SbModule* p = (SbModule*) pModules->Get( i ); + SbModule* p = static_cast<SbModule*>( pModules->Get( i ) ); if( p->IsVisible() ) { // Remember modul fpr Main() call @@ -1941,7 +1941,7 @@ bool StarBASIC::StoreData( SvStream& r ) const r.WriteUInt16( pModules->Count() ); for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { - SbModule* p = (SbModule*) pModules->Get( i ); + SbModule* p = static_cast<SbModule*>( pModules->Get( i ) ); if( !p->Store( r ) ) { return false; diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 9a37a84..3106708 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -884,8 +884,8 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) if( xObj->ISA(SbxDimArray) ) { - SbxBase* pObj = (SbxBase*)xObj; - SbxDimArray* pArray = (SbxDimArray*)pObj; + SbxBase* pObj = static_cast<SbxBase*>(xObj); + SbxDimArray* pArray = static_cast<SbxDimArray*>(pObj); short nDims = pArray->GetDims(); Type aElementType = getUnoTypeForSbxBaseType( (SbxDataType)(pArray->GetType() & 0xfff) ); @@ -977,12 +977,12 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal ) // No array, but ... else if( xObj->ISA(SbUnoObject) ) { - aRetType = ((SbUnoObject*)(SbxBase*)xObj)->getUnoAny().getValueType(); + aRetType = static_cast<SbUnoObject*>((SbxBase*)xObj)->getUnoAny().getValueType(); } // SbUnoAnyObject? else if( xObj->ISA(SbUnoAnyObject) ) { - aRetType = ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue().getValueType(); + aRetType = static_cast<SbUnoAnyObject*>((SbxBase*)xObj)->getValue().getValueType(); } // Otherwise it is a No-Uno-Basic-Object -> default==deliver void } @@ -1004,11 +1004,11 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType if( xObj.Is() ) { if( xObj->ISA(SbUnoAnyObject) ) - return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue(); + return static_cast<SbUnoAnyObject*>((SbxBase*)xObj)->getValue(); if( xObj->ISA(SbClassModuleObject) ) { Any aRetAny; - SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)xObj; + SbClassModuleObject* pClassModuleObj = static_cast<SbClassModuleObject*>((SbxBase*)xObj); SbModule* pClassModule = pClassModuleObj->getClassModule(); if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) ) return aRetAny; @@ -1205,7 +1205,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper SbxBaseRef xObj = (SbxBase*)pVar->GetObject(); if( xObj.Is() && xObj->ISA(SbUnoAnyObject) ) { - return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue(); + return static_cast<SbUnoAnyObject*>((SbxBase*)xObj)->getValue(); } } @@ -1260,11 +1260,11 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper SbxBaseRef pObj = (SbxBase*)pVar->GetObject(); if( pObj && pObj->ISA(SbUnoObject) ) { - aRetVal = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + aRetVal = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny(); } else if( pObj && pObj->ISA(SbUnoStructRefObject) ) { - aRetVal = ((SbUnoStructRefObject*)(SbxBase*)pObj)->getUnoAny(); + aRetVal = static_cast<SbUnoStructRefObject*>((SbxBase*)pObj)->getUnoAny(); } else { @@ -1286,7 +1286,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper SbxBaseRef pObj = (SbxBase*)pVar->GetObject(); if( pObj && pObj->ISA(SbUnoObject) ) { - Any aUnoAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + Any aUnoAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny(); aUnoAny >>= xIdlClass; } @@ -1322,8 +1322,8 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper SbxBaseRef xObj = (SbxBase*)pVar->GetObject(); if( xObj && xObj->ISA(SbxDimArray) ) { - SbxBase* pObj = (SbxBase*)xObj; - SbxDimArray* pArray = (SbxDimArray*)pObj; + SbxBase* pObj = static_cast<SbxBase*>(xObj); + SbxDimArray* pArray = static_cast<SbxDimArray*>(pObj); short nDims = pArray->GetDims(); @@ -3139,7 +3139,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) { return; } - Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + Any aAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny(); TypeClass eType = aAny.getValueType().getTypeClass(); if( eType != TypeClass_INTERFACE ) { @@ -3205,7 +3205,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) { return; } - Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + Any aAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny(); TypeClass eType = aAny.getValueType().getTypeClass(); if( eType == TypeClass_STRUCT ) { @@ -3240,7 +3240,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) { return; } - Any aAny1 = ((SbUnoObject*)(SbxBase*)pObj1)->getUnoAny(); + Any aAny1 = static_cast<SbUnoObject*>((SbxBase*)pObj1)->getUnoAny(); TypeClass eType1 = aAny1.getValueType().getTypeClass(); if( eType1 != TypeClass_INTERFACE ) { @@ -3259,7 +3259,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) { return; } - Any aAny2 = ((SbUnoObject*)(SbxBase*)pObj2)->getUnoAny(); + Any aAny2 = static_cast<SbUnoObject*>((SbxBase*)pObj2)->getUnoAny(); TypeClass eType2 = aAny2.getValueType().getTypeClass(); if( eType2 != TypeClass_INTERFACE ) { @@ -4269,7 +4269,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) SbxBaseRef pObj = (SbxBase*)pVal->GetObject(); if( pObj && pObj->ISA(SbUnoObject) ) { - Any aUnoAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + Any aUnoAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny(); aUnoAny >>= xIdlClass; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 7195f6d..5ff0767 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -845,7 +845,7 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, // Call of a subprogram SbModule* pOld = GetSbData()->pMod; GetSbData()->pMod = this; - Run( (SbMethod*) pVar ); + Run( static_cast<SbMethod*>(pVar) ); GetSbData()->pMod = pOld; } } @@ -1053,8 +1053,8 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic ) SbxObject* p = pBasic; while( p->GetParent() ) p = p->GetParent(); - if( ((StarBASIC*)p) != pBasic ) - ClearUnoObjectsInRTL_Impl_Rek( (StarBASIC*)p ); + if( static_cast<StarBASIC*>(p) != pBasic ) + ClearUnoObjectsInRTL_Impl_Rek( static_cast<StarBASIC*>(p) ); } @@ -1091,9 +1091,9 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth ) if( bDelInst ) { // #32779: Hold Basic during the execution - xBasic = (StarBASIC*) GetParent(); + xBasic = static_cast<StarBASIC*>( GetParent() ); - GetSbData()->pInst = new SbiInstance( (StarBASIC*) GetParent() ); + GetSbData()->pInst = new SbiInstance( static_cast<StarBASIC*>(GetParent()) ); /* If a VBA script in a document is started, get the VBA compatibility interface from the document Basic library container, and notify all @@ -1432,7 +1432,7 @@ void StarBASIC::ClearAllModuleVars( void ) // Initialise the own module for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { - SbModule* pModule = (SbModule*)pModules->Get( nMod ); + SbModule* pModule = static_cast<SbModule*>(pModules->Get( nMod )); // Initialise only, if the startcode was already executed if( pModule->pImage && pModule->pImage->bInit && !pModule->isProxyModule() && !pModule->ISA(SbObjModule) ) pModule->ClearPrivateVars(); @@ -1770,7 +1770,7 @@ void SbModule::GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache) ErrorHdlResetter aErrHdl; SbxBase::ResetError(); - boost::scoped_ptr<SbiParser> pParser(new SbiParser( (StarBASIC*) GetParent(), this )); + boost::scoped_ptr<SbiParser> pParser(new SbiParser( static_cast<StarBASIC*>(GetParent()), this )); pParser->SetCodeCompleting(true); while( pParser->Parse() ) {} @@ -2102,11 +2102,11 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller ) mCaller = pCaller; } // RefCount vom Modul hochzaehlen - SbModule* pMod_ = (SbModule*)GetParent(); + SbModule* pMod_ = static_cast<SbModule*>(GetParent()); pMod_->AddRef(); // Increment the RefCount of the Basic - StarBASIC* pBasic = (StarBASIC*)pMod_->GetParent(); + StarBASIC* pBasic = static_cast<StarBASIC*>(pMod_->GetParent()); pBasic->AddRef(); // Establish the values to get the return value @@ -2665,7 +2665,7 @@ void SbUserFormModule::InitObject() try { OUString aHook("VBAGlobals"); - SbUnoObject* pGlobs = (SbUnoObject*)GetParent()->Find( aHook, SbxCLASS_DONTCARE ); + SbUnoObject* pGlobs = static_cast<SbUnoObject*>(GetParent()->Find( aHook, SbxCLASS_DONTCARE )); if ( m_xModel.is() && pGlobs ) { // broadcast INITIALIZE_USERFORM script event before the dialog is created diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 5c1d06a..e0e1dec 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -365,13 +365,13 @@ void SbiCodeGen::Save() sal_uInt16 nCount = pParser->rTypeArray->Count(); for (i = 0; i < nCount; i++) { - p->AddType((SbxObject *)pParser->rTypeArray->Get(i)); + p->AddType(static_cast<SbxObject *>(pParser->rTypeArray->Get(i))); } // Insert enum objects nCount = pParser->rEnumArray->Count(); for (i = 0; i < nCount; i++) { - p->AddEnum((SbxObject *)pParser->rEnumArray->Get(i)); + p->AddEnum(static_cast<SbxObject *>(pParser->rEnumArray->Get(i))); } if( !p->IsError() ) { diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 8bb6718..183ecbb 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -954,7 +954,7 @@ bool SbModule::Compile() SbModule* pOld = GetSbData()->pCompMod; GetSbData()->pCompMod = this; - boost::scoped_ptr<SbiParser> pParser(new SbiParser( (StarBASIC*) GetParent(), this )); + boost::scoped_ptr<SbiParser> pParser(new SbiParser( static_cast<StarBASIC*>(GetParent()), this )); while( pParser->Parse() ) {} if( !pParser->GetErrors() ) pParser->aGen.Save(); diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index 1eda66c..9641289 100644 --- a/basic/source/runtime/ddectrl.cxx +++ b/basic/source/runtime/ddectrl.cxx @@ -22,7 +22,7 @@ #include "ddectrl.hxx" #include <basic/sberrors.hxx> -#define DDE_FREECHANNEL ((DdeConnection*)0xffffffff) +#define DDE_FREECHANNEL (reinterpret_cast<DdeConnection*>(0xffffffff)) #define DDE_FIRSTERR 0x4000 #define DDE_LASTERR 0x4011 diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 43b4d01..56879a7 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -117,13 +117,13 @@ RTLFUNC(CallByName) } // 1. parameter is object - SbxBase* pObjVar = (SbxObject*)rPar.Get(1)->GetObject(); + SbxBase* pObjVar = static_cast<SbxObject*>(rPar.Get(1)->GetObject()); SbxObject* pObj = NULL; if( pObjVar ) pObj = PTR_CAST(SbxObject,pObjVar); if( !pObj && pObjVar && pObjVar->ISA(SbxVariable) ) { - SbxBase* pObjVarObj = ((SbxVariable*)pObjVar)->GetObject(); + SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject(); pObj = PTR_CAST(SbxObject,pObjVarObj); } if( !pObj ) @@ -949,7 +949,7 @@ RTLFUNC(FindPropertyObject) return; } - SbxBase* pObjVar = (SbxObject*)rPar.Get(1)->GetObject(); + SbxBase* pObjVar = static_cast<SbxObject*>(rPar.Get(1)->GetObject()); SbxObject* pObj = NULL; if( pObjVar ) { @@ -957,7 +957,7 @@ RTLFUNC(FindPropertyObject) } if( !pObj && pObjVar && pObjVar->ISA(SbxVariable) ) { - SbxBase* pObjVarObj = ((SbxVariable*)pObjVar)->GetObject(); + SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject(); pObj = PTR_CAST(SbxObject,pObjVarObj); } diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index da9edc2..6550157 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -846,7 +846,7 @@ void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, rPar = pPar_ = new SbxArray; pPar_->Put( pVar, 0 ); } - p( (StarBASIC*) GetParent(), *pPar_, bWrite ); + p( static_cast<StarBASIC*>(GetParent()), *pPar_, bWrite ); return; } } diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 921745e..f6f0406 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -237,7 +237,7 @@ OUString SbxArray::GetAlias( sal_uInt16 nIdx ) SetError( SbxERR_PROP_WRITEONLY ); return OUString(); } - SbxVarEntry& rRef = (SbxVarEntry&) GetRef( nIdx ); + SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>(GetRef( nIdx )); if (!rRef.maAlias) return OUString(); @@ -253,7 +253,7 @@ void SbxArray::PutAlias( const OUString& rAlias, sal_uInt16 nIdx ) } else { - SbxVarEntry& rRef = (SbxVarEntry&) GetRef( nIdx ); + SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>( GetRef( nIdx ) ); rRef.maAlias.reset(rAlias); } } @@ -505,7 +505,7 @@ bool SbxArray::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { sal_uInt16 nIdx; rStrm.ReadUInt16( nIdx ); - SbxVariable* pVar = (SbxVariable*) Load( rStrm ); + SbxVariable* pVar = static_cast<SbxVariable*>(Load( rStrm )); if( pVar ) { SbxVariableRef& rRef = GetRef( nIdx ); diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 3932587..2e1d382 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits