diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-01 16:01:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-02 07:37:19 +0200 |
commit | 059f5a95b245252d72ea0930668bb222103dbd14 (patch) | |
tree | bf61e3f6d94b3df799ea3c9ce09b27322f7e86e1 | |
parent | 1777c425fef6420c37102dad9b7539424bb47d10 (diff) |
loplugin: cstylecast
Change-Id: Ic7c9c978baf5602a508aff5976220a02ed03a680
-rw-r--r-- | basic/source/classes/eventatt.cxx | 20 | ||||
-rw-r--r-- | basic/source/classes/image.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 24 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 34 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 20 | ||||
-rw-r--r-- | basic/source/comp/codegen.cxx | 4 | ||||
-rw-r--r-- | basic/source/comp/sbcomp.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/ddectrl.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxarray.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxcoll.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxcurr.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 20 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 2 |
16 files changed, 78 insertions, 78 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index b7b6fdc23133..3718e16de60a 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 d4be5e76167f..7a15cce28548 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 eed53e7c902a..bfcde23b3abf 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 9a37a8480a40..31067081eab8 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 7195f6d56f45..5ff07672600b 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 5c1d06a851d3..e0e1decaa9b3 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 8bb671841749..183ecbb1f6be 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 1eda66c0cfbe..96412890bd80 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 43b4d01858f2..56879a75e2f4 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 da9edc2111d0..6550157cc55b 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 921745e244da..f6f04060c24b 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 3932587238b5..2e1d382b2d10 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -92,7 +92,7 @@ SbxVariable* SbxCollection::FindUserData( sal_uInt32 nData ) { if( GetParameters() ) { - SbxObject* pObj = (SbxObject*) GetObject(); + SbxObject* pObj = static_cast<SbxObject*>(GetObject()); return pObj ? pObj->FindUserData( nData ) : NULL; } else @@ -105,7 +105,7 @@ SbxVariable* SbxCollection::Find( const OUString& rName, SbxClassType t ) { if( GetParameters() ) { - SbxObject* pObj = (SbxObject*) GetObject(); + SbxObject* pObj = static_cast<SbxObject*>(GetObject()); return pObj ? pObj->Find( rName, t ) : NULL; } else @@ -179,7 +179,7 @@ void SbxCollection::CollAdd( SbxArray* pPar_ ) } else { - Insert( (SbxObject*) pObj ); + Insert( static_cast<SbxObject*>(pObj) ); } } } diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx index 1634ad8057e5..0c9b8d3a871e 100644 --- a/basic/source/sbx/sbxcurr.cxx +++ b/basic/source/sbx/sbxcurr.cxx @@ -233,7 +233,7 @@ start: nRes = (sal_Int64)CURRENCY_FACTOR * (sal_Int64)(p->nByte); break; case SbxCHAR: - nRes = (sal_Int64)CURRENCY_FACTOR * (sal_Int64)(p->pChar); + nRes = (sal_Int64)CURRENCY_FACTOR * reinterpret_cast<sal_Int64>(p->pChar); break; case SbxBOOL: case SbxINTEGER: diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 4ff8e9e810e3..8d413208c0b1 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -320,10 +320,10 @@ SbxProperty* SbxObject::GetDfltProperty() { if ( !pDfltProp && !aDfltPropName.isEmpty() ) { - pDfltProp = (SbxProperty*) Find( aDfltPropName, SbxCLASS_PROPERTY ); + pDfltProp = static_cast<SbxProperty*>( Find( aDfltPropName, SbxCLASS_PROPERTY ) ); if( !pDfltProp ) { - pDfltProp = (SbxProperty*) Make( aDfltPropName, SbxCLASS_PROPERTY, SbxVARIANT ); + pDfltProp = static_cast<SbxProperty*>( Make( aDfltPropName, SbxCLASS_PROPERTY, SbxVARIANT ) ); } } return pDfltProp; @@ -480,7 +480,7 @@ void SbxObject::Insert( SbxVariable* pVar ) { if( pOld == pDfltProp ) { - pDfltProp = (SbxProperty*) pVar; + pDfltProp = static_cast<SbxProperty*>(pVar); } } } @@ -598,7 +598,7 @@ void SbxObject::Remove( SbxVariable* pVar ) static bool LoadArray( SvStream& rStrm, SbxObject* pThis, SbxArray* pArray ) { - SbxArrayRef p = (SbxArray*) SbxBase::Load( rStrm ); + SbxArrayRef p = static_cast<SbxArray*>( SbxBase::Load( rStrm ) ); if( !p.Is() ) { return false; @@ -663,7 +663,7 @@ bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer ) // Set properties if( !aDfltProp.isEmpty() ) { - pDfltProp = (SbxProperty*) pProps->Find( aDfltProp, SbxCLASS_PROPERTY ); + pDfltProp = static_cast<SbxProperty*>( pProps->Find( aDfltProp, SbxCLASS_PROPERTY ) ); } SetModified( false ); return true; @@ -717,7 +717,7 @@ OUString SbxObject::GenerateSource( const OUString &rLinePrefix, bool bLineFeed = false; for ( sal_uInt16 nProp = 0; nProp < xProps->Count(); ++nProp ) { - SbxPropertyRef xProp = (SbxProperty*) xProps->Get(nProp); + SbxPropertyRef xProp = static_cast<SbxProperty*>( xProps->Get(nProp) ); OUString aPropName( xProp->GetName() ); if ( xProp->CanWrite() && !( xProp->GetHashCode() == nNameHash && @@ -889,7 +889,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill ) pVar->GetValues_Impl().pObj != GetParent() ) { rStrm.WriteCharPtr( " contains " ); - ((SbxObject*) pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); + static_cast<SbxObject*>(pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); } else { @@ -928,7 +928,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill ) pVar->GetValues_Impl().pObj != GetParent() ) { rStrm.WriteCharPtr( " contains " ); - ((SbxObject*) pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); + static_cast<SbxObject*>(pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); } else { @@ -950,11 +950,11 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill ) rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( " - Sub" ); if ( pVar->ISA(SbxObject) ) { - ((SbxObject*) pVar)->Dump( rStrm, bFill ); + static_cast<SbxObject*>(pVar)->Dump( rStrm, bFill ); } else if ( pVar->ISA(SbxVariable) ) { - ((SbxVariable*) pVar)->Dump( rStrm, bFill ); + static_cast<SbxVariable*>(pVar)->Dump( rStrm, bFill ); } } } diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index b05afff3334d..be6bd871d000 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -733,7 +733,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const } // Test downcast!!! if( this->ISA(SbxVariable) ) - ((SbxVariable*)this)->Broadcast( SBX_HINT_DATAWANTED ); + const_cast<SbxVariable*>(static_cast<const SbxVariable*>(this))->Broadcast( SBX_HINT_DATAWANTED ); SbxDataType t = GetType(); if( t == SbxSTRING ) { diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 01d5f3461861..ba32676f4335 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -720,7 +720,7 @@ void SbxVariable::Dump( SvStream& rStrm, bool bFill ) GetValues_Impl().pObj != GetParent() ) { rStrm.WriteCharPtr( " contains " ); - ((SbxObject*) GetValues_Impl().pObj)->Dump( rStrm, bFill ); + static_cast<SbxObject*>(GetValues_Impl().pObj)->Dump( rStrm, bFill ); } else { |