summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-08 16:23:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-08 16:23:17 +0200
commit761e0ae0a72f635564fef35852e0c87c755e3bd7 (patch)
tree9de5b02ba18f4531f931aea76620b8ebd02895d1 /basic
parentd7b2fe39be4b65af4cebe87a38786e4843e58329 (diff)
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I8bce930283301130ec7a2b1eab2a2c8f65c8abf9
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/cppunit/basictest.hxx2
-rw-r--r--basic/source/basmgr/basmgr.cxx16
-rw-r--r--basic/source/classes/eventatt.cxx10
-rw-r--r--basic/source/classes/propacc.cxx4
-rw-r--r--basic/source/classes/sb.cxx2
-rw-r--r--basic/source/classes/sbunoobj.cxx114
-rw-r--r--basic/source/classes/sbxmod.cxx6
-rw-r--r--basic/source/comp/exprtree.cxx2
-rw-r--r--basic/source/comp/parser.cxx2
-rw-r--r--basic/source/runtime/ddectrl.cxx2
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/runtime/runtime.cxx26
-rw-r--r--basic/source/sbx/sbxarray.cxx4
-rw-r--r--basic/source/sbx/sbxexec.cxx2
-rw-r--r--basic/source/sbx/sbxobj.cxx4
-rw-r--r--basic/source/sbx/sbxvalue.cxx4
-rw-r--r--basic/source/uno/namecont.cxx6
-rw-r--r--basic/source/uno/scriptcont.cxx2
18 files changed, 105 insertions, 105 deletions
diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index f8ac9f8510d6..c3d16cf8ae89 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -107,7 +107,7 @@ class MacroSnippet
}
pMeth->SetParameters( aArgs );
}
- pReturn = new SbxMethod( *((SbxMethod*)pMeth));
+ pReturn = new SbxMethod( *static_cast<SbxMethod*>(pMeth));
}
return pReturn;
}
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index c7a847654f7c..a740ee5c09b9 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1087,7 +1087,7 @@ bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) con
{
if( xNew->IsA( TYPE(StarBASIC) ) )
{
- StarBASIC* pNew = static_cast<StarBASIC*>((SbxBase*) xNew);
+ StarBASIC* pNew = static_cast<StarBASIC*>(static_cast<SbxBase*>(xNew));
// Use the Parent of the old BASICs
if( rOldBasic.Is() )
{
@@ -1846,8 +1846,8 @@ uno::Any ModuleContainer_Impl::getByName( const OUString& aName )
SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL;
if( !pMod )
throw container::NoSuchElementException();
- uno::Reference< script::XStarBasicModuleInfo > xMod = (XStarBasicModuleInfo*)new ModuleInfo_Impl
- ( aName, "StarBasic", pMod->GetSource32() );
+ uno::Reference< script::XStarBasicModuleInfo > xMod = static_cast<XStarBasicModuleInfo*>(new ModuleInfo_Impl
+ ( aName, "StarBasic", pMod->GetSource32() ));
uno::Any aRetAny;
aRetAny <<= xMod;
return aRetAny;
@@ -2011,8 +2011,8 @@ uno::Any DialogContainer_Impl::getByName( const OUString& aName )
}
uno::Reference< script::XStarBasicDialogInfo > xDialog =
- (XStarBasicDialogInfo*)new DialogInfo_Impl
- ( aName, implGetDialogData( static_cast<SbxObject*>(pVar) ) );
+ static_cast<XStarBasicDialogInfo*>(new DialogInfo_Impl
+ ( aName, implGetDialogData( static_cast<SbxObject*>(pVar) ) ));
uno::Any aRetAny;
aRetAny <<= xDialog;
@@ -2157,10 +2157,10 @@ uno::Any LibraryContainer_Impl::getByName( const OUString& aName )
StarBASIC* pLib = mpMgr->GetLib( aName );
uno::Reference< container::XNameContainer > xModuleContainer =
- (container::XNameContainer*)new ModuleContainer_Impl( pLib );
+ static_cast<container::XNameContainer*>(new ModuleContainer_Impl( pLib ));
uno::Reference< container::XNameContainer > xDialogContainer =
- (container::XNameContainer*)new DialogContainer_Impl( pLib );
+ static_cast<container::XNameContainer*>(new DialogContainer_Impl( pLib ));
BasicLibInfo* pLibInfo = mpMgr->FindLibInfo( pLib );
@@ -2273,7 +2273,7 @@ uno::Reference< container::XNameContainer > SAL_CALL StarBasicAccess_Impl::getLi
throw(uno::RuntimeException, std::exception)
{
if( !mxLibContainer.is() )
- mxLibContainer = (container::XNameContainer*)new LibraryContainer_Impl( mpMgr );
+ mxLibContainer = static_cast<container::XNameContainer*>(new LibraryContainer_Impl( mpMgr ));
return mxLibContainer;
}
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 6472d00d0cad..0f79fdd84a90 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -260,7 +260,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
StarBASIC* pBasic;
if( nObj == -1 )
{
- pBasic = (StarBASIC*)xLibSearchBasic;
+ pBasic = static_cast<StarBASIC*>(xLibSearchBasic);
}
else
{
@@ -303,7 +303,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
for( sal_Int32 i = 0; i < nCnt; i++ )
{
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
- unoToSbxValue( (SbxVariable*)xVar, pArgs[i] );
+ unoToSbxValue( static_cast<SbxVariable*>(xVar), pArgs[i] );
xArray->Put( xVar, sal::static_int_cast< sal_uInt16 >(i+1) );
}
}
@@ -335,7 +335,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog
SbxVariable* pDlgLibContVar = pBasic->Find(OUString("DialogLibraries"), SbxCLASS_OBJECT);
if( pDlgLibContVar && pDlgLibContVar->ISA(SbUnoObject) )
{
- SbUnoObject* pDlgLibContUnoObj = static_cast<SbUnoObject*>((SbxBase*)pDlgLibContVar);
+ SbUnoObject* pDlgLibContUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pDlgLibContVar));
Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny();
Reference< XLibraryContainer > xDlgLibContNameAccess( aDlgLibContAny, UNO_QUERY );
@@ -437,7 +437,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- SbUnoObject* pUnoObj = static_cast<SbUnoObject*>((SbxBase*)pObj);
+ SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj));
Any aAnyISP = pUnoObj->getUnoAny();
TypeClass eType = aAnyISP.getValueType().getTypeClass();
@@ -558,7 +558,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
Any aRetVal;
aRetVal <<= xCntrl;
SbxVariableRef refVar = rPar.Get(0);
- unoToSbxValue( (SbxVariable*)refVar, aRetVal );
+ unoToSbxValue( static_cast<SbxVariable*>(refVar), aRetVal );
}
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx
index adfac826b078..677897a97cc3 100644
--- a/basic/source/classes/propacc.cxx
+++ b/basic/source/classes/propacc.cxx
@@ -279,7 +279,7 @@ void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, bool bWrite
// Get class names of struct
OUString aServiceName( "stardiv.uno.beans.PropertySet");
- Reference< XInterface > xInterface = (OWeakObject*) new SbPropertyValues();
+ Reference< XInterface > xInterface = static_cast<OWeakObject*>(new SbPropertyValues());
SbxVariableRef refVar = rPar.Get(0);
if( xInterface.is() )
@@ -299,7 +299,7 @@ void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, bool bWrite
if( xUnoObj->getUnoAny().getValueType().getTypeClass() != TypeClass_VOID )
{
// Return object
- refVar->PutObject( (SbUnoObject*)xUnoObj );
+ refVar->PutObject( static_cast<SbUnoObject*>(xUnoObj) );
return;
}
}
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 647e2128cc7f..cd22751726c5 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1342,7 +1342,7 @@ SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t )
}
if( !pRes )
{
- pRes = static_cast<SbiStdObject*>((SbxObject*) pRtl)->Find( rName, t );
+ pRes = static_cast<SbiStdObject*>(static_cast<SbxObject*>(pRtl))->Find( rName, t );
}
if( pRes )
{
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 6bc596fcc568..33db5c1462e0 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -610,10 +610,10 @@ static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int
if ( pArray )
{
SbxVariableRef xVar = new SbxVariable( eSbxElementType );
- unoToSbxValue( (SbxVariable*)xVar, aValue );
+ unoToSbxValue( static_cast<SbxVariable*>(xVar), aValue );
sal_Int32* pIndices = indices.getArray();
- pArray->Put32( (SbxVariable*)xVar, pIndices );
+ pArray->Put32( static_cast<SbxVariable*>(xVar), pIndices );
}
}
@@ -637,7 +637,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
// instantiate SbUnoObject
OUString aName;
SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aClassAny );
- SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject;
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(pSbUnoObject);
// If the object is invalid deliver null
if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID )
@@ -671,7 +671,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
SbxDimArrayRef xArray = pArray;
SbxFlagBits nFlags = pVar->GetFlags();
pVar->ResetFlag( SBX_FIXED );
- pVar->PutObject( (SbxDimArray*)xArray );
+ pVar->PutObject( static_cast<SbxDimArray*>(xArray) );
pVar->SetFlags( nFlags );
}
else
@@ -738,7 +738,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
pSbUnoObject->SetDfltProperty( sDfltPropName );
}
}
- SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject;
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(pSbUnoObject);
// If the object is invalid deliver null
if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID )
@@ -787,10 +787,10 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
// convert elements
Any aElementAny = xIdlArray->get( aValue, (sal_uInt32)i );
SbxVariableRef xVar = new SbxVariable( eSbxElementType );
- unoToSbxValue( (SbxVariable*)xVar, aElementAny );
+ unoToSbxValue( static_cast<SbxVariable*>(xVar), aElementAny );
// put into the Array
- xArray->Put32( (SbxVariable*)xVar, &i );
+ xArray->Put32( static_cast<SbxVariable*>(xVar), &i );
}
}
else
@@ -801,7 +801,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
// return the Array
SbxFlagBits nFlags = pVar->GetFlags();
pVar->ResetFlag( SBX_FIXED );
- pVar->PutObject( (SbxDimArray*)xArray );
+ pVar->PutObject( static_cast<SbxDimArray*>(xArray) );
pVar->SetFlags( nFlags );
}
@@ -907,7 +907,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
{
// coverity[callee_ptr_arith]
SbxVariableRef xVar = pArray->Get32( &nIdx );
- Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar );
+ Type aType = getUnoTypeForSbxValue( static_cast<SbxVariable*>(xVar) );
if( bNeedsInit )
{
if( aType.getTypeClass() == TypeClass_VOID )
@@ -944,7 +944,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
for( sal_uInt32 i = 0 ; i < nFlatArraySize ; i++ )
{
SbxVariableRef xVar = pArray->SbxArray::Get32( i );
- Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar );
+ Type aType = getUnoTypeForSbxValue( static_cast<SbxVariable*>(xVar) );
if( bNeedsInit )
{
if( aType.getTypeClass() == TypeClass_VOID )
@@ -978,12 +978,12 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
// No array, but ...
else if( xObj->ISA(SbUnoObject) )
{
- aRetType = static_cast<SbUnoObject*>((SbxBase*)xObj)->getUnoAny().getValueType();
+ aRetType = static_cast<SbUnoObject*>(static_cast<SbxBase*>(xObj))->getUnoAny().getValueType();
}
// SbUnoAnyObject?
else if( xObj->ISA(SbUnoAnyObject) )
{
- aRetType = static_cast<SbUnoAnyObject*>((SbxBase*)xObj)->getValue().getValueType();
+ aRetType = static_cast<SbUnoAnyObject*>(static_cast<SbxBase*>(xObj))->getValue().getValueType();
}
// Otherwise it is a No-Uno-Basic-Object -> default==deliver void
}
@@ -1005,11 +1005,11 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
if( xObj.Is() )
{
if( xObj->ISA(SbUnoAnyObject) )
- return static_cast<SbUnoAnyObject*>((SbxBase*)xObj)->getValue();
+ return static_cast<SbUnoAnyObject*>(static_cast<SbxBase*>(xObj))->getValue();
if( xObj->ISA(SbClassModuleObject) )
{
Any aRetAny;
- SbClassModuleObject* pClassModuleObj = static_cast<SbClassModuleObject*>((SbxBase*)xObj);
+ SbClassModuleObject* pClassModuleObj = static_cast<SbClassModuleObject*>(static_cast<SbxBase*>(xObj));
SbModule* pClassModule = pClassModuleObj->getClassModule();
if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
return aRetAny;
@@ -1206,7 +1206,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
SbxBaseRef xObj = pVar->GetObject();
if( xObj.Is() && xObj->ISA(SbUnoAnyObject) )
{
- return static_cast<SbUnoAnyObject*>((SbxBase*)xObj)->getValue();
+ return static_cast<SbUnoAnyObject*>(static_cast<SbxBase*>(xObj))->getValue();
}
}
@@ -1261,11 +1261,11 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
SbxBaseRef pObj = pVar->GetObject();
if( pObj && pObj->ISA(SbUnoObject) )
{
- aRetVal = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny();
+ aRetVal = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
}
else if( pObj && pObj->ISA(SbUnoStructRefObject) )
{
- aRetVal = static_cast<SbUnoStructRefObject*>((SbxBase*)pObj)->getUnoAny();
+ aRetVal = static_cast<SbUnoStructRefObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
}
else
{
@@ -1287,7 +1287,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
SbxBaseRef pObj = pVar->GetObject();
if( pObj && pObj->ISA(SbUnoObject) )
{
- Any aUnoAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny();
+ Any aUnoAny = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
aUnoAny >>= xIdlClass;
}
@@ -1355,7 +1355,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
SbxVariableRef xVar = pArray->Get32( &nIdx );
// Convert the value of Sbx to Uno
- Any aAnyValue = sbxToUnoValue( (SbxVariable*)xVar, aElemType );
+ Any aAnyValue = sbxToUnoValue( static_cast<SbxVariable*>(xVar), aElemType );
try
{
@@ -2089,7 +2089,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
if ( pProp->isUnoStruct() )
{
SbUnoStructRefObject* pSbUnoObject = new SbUnoStructRefObject( pProp->GetName(), aMember );
- SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject;
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(pSbUnoObject);
pVar->PutObject( xWrapper );
}
else
@@ -2676,7 +2676,7 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
// create the property and superimpose it
SbUnoProperty* pProp = new SbUnoProperty( rProp.Name, eSbxType, eRealSbxType, rProp, 0, false, ( rProp.Type.getTypeClass() == com::sun::star::uno::TypeClass_STRUCT ) );
SbxVariableRef xVarRef = pProp;
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
pRes = xVarRef;
}
else if( mxUnoAccess->hasMethod( aUName,
@@ -2689,7 +2689,7 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
// create SbUnoMethod and superimpose it
SbxVariableRef xMethRef = new SbUnoMethod( rxMethod->getName(),
unoToSbxType( rxMethod->getReturnType() ), rxMethod, false );
- QuickInsert( (SbxVariable*)xMethRef );
+ QuickInsert( static_cast<SbxVariable*>(xMethRef) );
pRes = xMethRef;
}
@@ -2747,14 +2747,14 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
{
// create a property and superimpose it
SbxVariableRef xVarRef = new SbUnoProperty( aUName, SbxVARIANT, SbxVARIANT, aDummyProp, 0, true, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
pRes = xVarRef;
}
else if( mxInvocation->hasMethod( aUName ) )
{
// create SbUnoMethode and superimpose it
SbxVariableRef xMethRef = new SbUnoMethod( aUName, SbxVARIANT, xDummyMethod, true );
- QuickInsert( (SbxVariable*)xMethRef );
+ QuickInsert( static_cast<SbxVariable*>(xMethRef) );
pRes = xMethRef;
}
else
@@ -2763,7 +2763,7 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
if ( xDirectInvoke.is() && xDirectInvoke->hasMember( aUName ) )
{
SbxVariableRef xMethRef = new SbUnoMethod( aUName, SbxVARIANT, xDummyMethod, true, true );
- QuickInsert( (SbxVariable*)xMethRef );
+ QuickInsert( static_cast<SbxVariable*>(xMethRef) );
pRes = xMethRef;
}
@@ -2806,15 +2806,15 @@ void SbUnoObject::implCreateDbgProperties()
// Id == -1: display the implemented interfaces corresponding the ClassProvider
SbxVariableRef xVarRef = new SbUnoProperty( OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
// Id == -2: output the properties
xVarRef = new SbUnoProperty( OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
// Id == -3: output the Methods
xVarRef = new SbUnoProperty( OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
}
void SbUnoObject::implCreateAll()
@@ -2857,7 +2857,7 @@ void SbUnoObject::implCreateAll()
SbxDataType eRealSbxType = ( ( rProp.Attributes & PropertyAttribute::MAYBEVOID ) ? unoToSbxType( rProp.Type.getTypeClass() ) : eSbxType );
// Create property and superimpose it
SbxVariableRef xVarRef = new SbUnoProperty( rProp.Name, eSbxType, eRealSbxType, rProp, i, false, ( rProp.Type.getTypeClass() == com::sun::star::uno::TypeClass_STRUCT ) );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
}
// Create Dbg_-Properties
@@ -2876,7 +2876,7 @@ void SbUnoObject::implCreateAll()
// Create SbUnoMethod and superimpose it
SbxVariableRef xMethRef = new SbUnoMethod
( rxMethod->getName(), unoToSbxType( rxMethod->getReturnType() ), rxMethod, false );
- QuickInsert( (SbxVariable*)xMethRef );
+ QuickInsert( static_cast<SbxVariable*>(xMethRef) );
}
}
@@ -2988,7 +2988,7 @@ void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
}
// return the object
SbxVariableRef refVar = rPar.Get(0);
- refVar->PutObject( (SbUnoObject*)xUnoObj );
+ refVar->PutObject( static_cast<SbUnoObject*>(xUnoObj) );
}
void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
@@ -3029,7 +3029,7 @@ void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
if( xUnoObj->getUnoAny().getValueType().getTypeClass() != TypeClass_VOID )
{
// return the object
- refVar->PutObject( (SbUnoObject*)xUnoObj );
+ refVar->PutObject( static_cast<SbUnoObject*>(xUnoObj) );
}
else
{
@@ -3084,7 +3084,7 @@ void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar,
if( xUnoObj->getUnoAny().getValueType().getTypeClass() != TypeClass_VOID )
{
// return the object
- refVar->PutObject( (SbUnoObject*)xUnoObj );
+ refVar->PutObject( static_cast<SbUnoObject*>(xUnoObj) );
}
else
{
@@ -3111,7 +3111,7 @@ void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, bool
// Create a SbUnoObject out of it and return it
SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "ProcessServiceManager" ), aAny );
- refVar->PutObject( (SbUnoObject*)xUnoObj );
+ refVar->PutObject( static_cast<SbUnoObject*>(xUnoObj) );
}
void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
@@ -3137,7 +3137,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
{
return;
}
- Any aAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny();
+ Any aAny = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
TypeClass eType = aAny.getValueType().getTypeClass();
if( eType != TypeClass_INTERFACE )
{
@@ -3203,7 +3203,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
{
return;
}
- Any aAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny();
+ Any aAny = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
TypeClass eType = aAny.getValueType().getTypeClass();
if( eType == TypeClass_STRUCT )
{
@@ -3238,7 +3238,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
{
return;
}
- Any aAny1 = static_cast<SbUnoObject*>((SbxBase*)pObj1)->getUnoAny();
+ Any aAny1 = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj1))->getUnoAny();
TypeClass eType1 = aAny1.getValueType().getTypeClass();
if( eType1 != TypeClass_INTERFACE )
{
@@ -3257,7 +3257,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
{
return;
}
- Any aAny2 = static_cast<SbUnoObject*>((SbxBase*)pObj2)->getUnoAny();
+ Any aAny2 = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj2))->getUnoAny();
TypeClass eType2 = aAny2.getValueType().getTypeClass();
if( eType2 != TypeClass_INTERFACE )
{
@@ -3476,7 +3476,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
if( xClass.is() )
{
pRes = new SbxVariable( SbxVARIANT );
- SbxObjectRef xWrapper = (SbxObject*)new SbUnoClass( aNewName, xClass );
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(new SbUnoClass( aNewName, xClass ));
pRes->PutObject( xWrapper );
}
}
@@ -3498,7 +3498,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
if( pNewClass )
{
pRes = new SbxVariable( SbxVARIANT );
- SbxObjectRef xWrapper = (SbxObject*)pNewClass;
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(pNewClass);
pRes->PutObject( xWrapper );
}
}
@@ -3510,7 +3510,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
if( pUnoService )
{
pRes = new SbxVariable( SbxVARIANT );
- SbxObjectRef xWrapper = (SbxObject*)pUnoService;
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(pUnoService);
pRes->PutObject( xWrapper );
}
}
@@ -3522,7 +3522,7 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
if( pUnoSingleton )
{
pRes = new SbxVariable( SbxVARIANT );
- SbxObjectRef xWrapper = (SbxObject*)pUnoSingleton;
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(pUnoSingleton);
pRes->PutObject( xWrapper );
}
}
@@ -3602,7 +3602,7 @@ SbxVariable* SbUnoService::Find( const OUString& rName, SbxClassType )
{
// Create and insert SbUnoServiceCtor
SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor );
- QuickInsert( (SbxVariable*)xSbCtorRef );
+ QuickInsert( static_cast<SbxVariable*>(xSbCtorRef) );
}
}
pRes = SbxObject::Find( rName, SbxCLASS_METHOD );
@@ -3830,7 +3830,7 @@ SbUnoSingleton::SbUnoSingleton( const OUString& aName_,
, m_xSingletonTypeDesc( xSingletonTypeDesc )
{
SbxVariableRef xGetMethodRef = new SbxMethod( OUString( "get" ), SbxOBJECT );
- QuickInsert( (SbxVariable*)xGetMethodRef );
+ QuickInsert( static_cast<SbxVariable*>(xGetMethodRef) );
}
void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
@@ -3945,7 +3945,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet
{
// Convert elements
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
- unoToSbxValue( (SbxVariable*)xVar, pArgs[i] );
+ unoToSbxValue( static_cast<SbxVariable*>(xVar), pArgs[i] );
xSbxArray->Put( xVar, sal::static_int_cast< sal_uInt16 >(i+1) );
}
@@ -4036,7 +4036,7 @@ Reference< XInterface > createAllListenerAdapter
if( xInvocationAdapterFactory.is() && xListenerType.is() && xListener.is() )
{
Reference< XInvocation > xInvocationToAllListenerMapper =
- (XInvocation*)new InvocationToAllListenerMapper( xListenerType, xListener, Helper );
+ static_cast<XInvocation*>(new InvocationToAllListenerMapper( xListenerType, xListener, Helper ));
Type aListenerType( xListenerType->getTypeClass(), xListenerType->getName() );
Sequence<Type> arg2(1);
arg2[0] = aListenerType;
@@ -4105,7 +4105,7 @@ Any SAL_CALL InvocationToAllListenerMapper::invoke(const OUString& FunctionName,
}
AllEventObject aAllEvent;
- aAllEvent.Source = (OWeakObject*) this;
+ aAllEvent.Source = static_cast<OWeakObject*>(this);
aAllEvent.Helper = m_Helper;
aAllEvent.ListenerType = Type(m_xListenerType->getTypeClass(), m_xListenerType->getName() );
aAllEvent.MethodName = FunctionName;
@@ -4227,7 +4227,7 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, bool bWrite
Any aContextAny( comphelper::getProcessComponentContext() );
SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "DefaultContext" ), aContextAny );
- refVar->PutObject( (SbUnoObject*)xUnoObj );
+ refVar->PutObject( static_cast<SbUnoObject*>(xUnoObj) );
}
@@ -4267,7 +4267,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
SbxBaseRef pObj = pVal->GetObject();
if( pObj && pObj->ISA(SbUnoObject) )
{
- Any aUnoAny = static_cast<SbUnoObject*>((SbxBase*)pObj)->getUnoAny();
+ Any aUnoAny = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
aUnoAny >>= xIdlClass;
}
@@ -4403,7 +4403,7 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A
// Setup parameter
SbxArrayRef xArray = new SbxArray;
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
- unoToSbxValue( (SbxVariable*)xVar, rValue );
+ unoToSbxValue( static_cast<SbxVariable*>(xVar), rValue );
xArray->Put( xVar, 1 );
// Call property method
@@ -4507,7 +4507,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
for( sal_Int32 i = 0 ; i < nParamCount ; i++ )
{
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
- unoToSbxValue( (SbxVariable*)xVar, pArgs[i] );
+ unoToSbxValue( static_cast<SbxVariable*>(xVar), pArgs[i] );
xArray->Put( xVar, sal::static_int_cast< sal_uInt16 >(i+1) );
}
}
@@ -4533,7 +4533,7 @@ void SAL_CALL ModuleInvocationProxy::dispose()
{
::osl::MutexGuard aGuard( m_aMutex );
- EventObject aEvent( (XComponent*)this );
+ EventObject aEvent( static_cast<XComponent*>(this) );
m_aListeners.disposeAndClear( aEvent );
m_xScopeObj = NULL;
@@ -4876,7 +4876,7 @@ SbxVariable* SbUnoStructRefObject::Find( const OUString& rName, SbxClassType t )
aProp.Type = com::sun::star::uno::Type( it->second->getTypeClass(), it->second->getTypeName() );
SbUnoProperty* pProp = new SbUnoProperty( rName, eSbxType, eRealSbxType, aProp, 0, false, ( aProp.Type.getTypeClass() == com::sun::star::uno::TypeClass_STRUCT) );
SbxVariableRef xVarRef = pProp;
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
pRes = xVarRef;
}
}
@@ -4905,15 +4905,15 @@ void SbUnoStructRefObject::implCreateDbgProperties()
// Id == -1: display the implemented interfaces corresponding the ClassProvider
SbxVariableRef xVarRef = new SbUnoProperty( OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
// Id == -2: output the properties
xVarRef = new SbUnoProperty( OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
// Id == -3: output the Methods
xVarRef = new SbUnoProperty( OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false );
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
}
void SbUnoStructRefObject::implCreateAll()
@@ -4936,7 +4936,7 @@ void SbUnoStructRefObject::implCreateAll()
aProp.Type = com::sun::star::uno::Type( it->second->getTypeClass(), it->second->getTypeName() );
SbUnoProperty* pProp = new SbUnoProperty( rName, eSbxType, eRealSbxType, aProp, 0, false, ( aProp.Type.getTypeClass() == com::sun::star::uno::TypeClass_STRUCT) );
SbxVariableRef xVarRef = pProp;
- QuickInsert( (SbxVariable*)xVarRef );
+ QuickInsert( static_cast<SbxVariable*>(xVarRef) );
}
// Create Dbg_-Properties
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 81af910b8984..59f40049a58c 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -333,7 +333,7 @@ DocObjectWrapper::setValue( const OUString& aPropertyName, const Any& aValue ) t
SbPropertyRef pProperty = getProperty( aPropertyName );
if ( !pProperty.Is() )
throw UnknownPropertyException();
- unoToSbxValue( (SbxVariable*) pProperty, aValue );
+ unoToSbxValue( static_cast<SbxVariable*>(pProperty), aValue );
}
Any SAL_CALL
@@ -346,7 +346,7 @@ DocObjectWrapper::getValue( const OUString& aPropertyName ) throw (UnknownProper
if ( !pProperty.Is() )
throw UnknownPropertyException();
- SbxVariable* pProp = ( SbxVariable* ) pProperty;
+ SbxVariable* pProp = static_cast<SbxVariable*>(pProperty);
if ( pProp->GetType() == SbxEMPTY )
pProperty->Broadcast( SBX_HINT_DATAWANTED );
@@ -2198,7 +2198,7 @@ SbObjModule::~SbObjModule()
void
SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxVariable*)pDocObject);
+ SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,static_cast<SbxVariable*>(pDocObject));
if ( pUnoObj && pUnoObj->getUnoAny() == aObj ) // object is equal, nothing to do
return;
pDocObject = new SbUnoObject( GetName(), aObj );
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 2e133b88c487..5dbad2a82b6b 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -107,7 +107,7 @@ static bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTo
}
else // check for default params with reserved names ( e.g. names of tokens )
{
- SbiTokenizer tokens( *(SbiTokenizer*)p );
+ SbiTokenizer tokens( *static_cast<SbiTokenizer*>(p) );
// Urk the Next() / Peek() symantics are... weird
tokens.Next();
if ( tokens.Peek() == ASSIGN )
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 13ed16e19b4c..c25792284380 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -388,7 +388,7 @@ bool SbiParser::Parse()
// a runtime error
if ( eCurTok == _ERROR_ && IsVBASupportOn() ) // we probably need to define a subset of keywords where this madness applies e.g. if ( IsVBASupportOn() && SymbolCanBeRedined( eCurTok ) )
{
- SbiTokenizer tokens( *(SbiTokenizer*)this );
+ SbiTokenizer tokens( *static_cast<SbiTokenizer*>(this) );
tokens.Next();
if ( tokens.Peek() == DOT )
{
diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx
index 9f7149cf332d..d4aab312dd01 100644
--- a/basic/source/runtime/ddectrl.cxx
+++ b/basic/source/runtime/ddectrl.cxx
@@ -69,7 +69,7 @@ SbError SbiDdeControl::GetLastErr( DdeConnection* pConv )
IMPL_LINK( SbiDdeControl,Data , DdeData*, pData )
{
- aData = OUString::createFromAscii( static_cast<const char*>((const void*)*pData) );
+ aData = OUString::createFromAscii( static_cast<const char*>(static_cast<const void*>(*pData)) );
return 1;
}
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index ea1d8c207c00..5a86549402a8 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4526,7 +4526,7 @@ RTLFUNC(LoadPicture)
Graphic aGraphic(aBmp);
SbxObjectRef xRef = new SbStdPicture;
- static_cast<SbStdPicture*>((SbxObject*)xRef)->SetGraphic( aGraphic );
+ static_cast<SbStdPicture*>(static_cast<SbxObject*>(xRef))->SetGraphic( aGraphic );
rPar.Get(0)->PutObject( xRef );
}
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index dac00d643d1e..8b92c8e5cf26 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1648,8 +1648,8 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
if( !xValObj.Is() || xValObj->ISA(SbUnoAnyObject) )
return false;
- SbUnoObject* pUnoVal = PTR_CAST(SbUnoObject,(SbxObject*)xValObj);
- SbUnoStructRefObject* pUnoStructVal = PTR_CAST(SbUnoStructRefObject,(SbxObject*)xValObj);
+ SbUnoObject* pUnoVal = PTR_CAST(SbUnoObject,static_cast<SbxObject*>(xValObj));
+ SbUnoStructRefObject* pUnoStructVal = PTR_CAST(SbUnoStructRefObject,static_cast<SbxObject*>(xValObj));
Any aAny;
// make doubly sure value is either an Uno object or
// an uno struct
@@ -1671,7 +1671,7 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
else
SbxBase::ResetError();
- SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,(SbxObject*)xVarObj);
+ SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,static_cast<SbxObject*>(xVarObj));
OUString sClassName = pUnoVal ? pUnoVal->GetClassName() : pUnoStructVal->GetClassName();
OUString sName = pUnoVal ? pUnoVal->GetName() : pUnoStructVal->GetName();
@@ -2249,7 +2249,7 @@ void SbiRuntime::StepREDIMP()
{
SbxBase* pElemObj = refVar->GetObject();
SbxDimArray* pNewArray = PTR_CAST(SbxDimArray,pElemObj);
- SbxDimArray* pOldArray = static_cast<SbxDimArray*>((SbxArray*)refRedimpArray);
+ SbxDimArray* pOldArray = static_cast<SbxDimArray*>(static_cast<SbxArray*>(refRedimpArray));
if( pNewArray )
{
short nDimsNew = pNewArray->GetDims();
@@ -3037,7 +3037,7 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
}
else
{
- SbxDimArray* pArray = reinterpret_cast<SbxDimArray*>((SbxVariable*)p->refEnd);
+ SbxDimArray* pArray = reinterpret_cast<SbxDimArray*>(static_cast<SbxVariable*>(p->refEnd));
short nDims = pArray->GetDims();
// Empty array?
@@ -3071,7 +3071,7 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
}
case FOR_EACH_COLLECTION:
{
- BasicCollection* pCollection = static_cast<BasicCollection*>((SbxVariable*)pForStk->refEnd);
+ BasicCollection* pCollection = static_cast<BasicCollection*>(static_cast<SbxVariable*>(pForStk->refEnd));
SbxArrayRef xItemArray = pCollection->xItemArray;
sal_Int32 nCount = xItemArray->Count32();
if( pForStk->nCurCollectionIndex < nCount )
@@ -3725,7 +3725,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
SbxBaseRef pObj = p->GetObject();
if( pObj && pObj->ISA(SbUnoObject) )
{
- SbUnoObject* pUnoObj = static_cast<SbUnoObject*>((SbxBase*)pObj);
+ SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj));
Any aAny = pUnoObj->getUnoAny();
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
@@ -3853,7 +3853,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
{
if( pObj->ISA(SbUnoObject) )
{
- SbUnoObject* pUnoObj = static_cast<SbUnoObject*>((SbxBase*)pObj);
+ SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj));
Any aAny = pUnoObj->getUnoAny();
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
@@ -3898,7 +3898,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
// #67173 don't specify a name so that the real class name is entered
OUString aName;
- SbxObjectRef xWrapper = (SbxObject*)new SbUnoObject( aName, aAny );
+ SbxObjectRef xWrapper = static_cast<SbxObject*>(new SbUnoObject( aName, aAny ));
pElem->PutObject( xWrapper );
}
else
@@ -3924,7 +3924,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
{
if( pDfltObj->ISA(SbUnoObject) )
{
- pUnoObj = static_cast<SbUnoObject*>((SbxBase*)pDfltObj);
+ pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pDfltObj));
Any aUnoAny = pUnoObj->getUnoAny();
if( aUnoAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
@@ -3964,7 +3964,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
else if( pObj->ISA(BasicCollection) )
{
- BasicCollection* pCol = static_cast<BasicCollection*>((SbxBase*)pObj);
+ BasicCollection* pCol = static_cast<BasicCollection*>(static_cast<SbxBase*>(pObj));
pElem = new SbxVariable( SbxVARIANT );
pPar->Put( pElem, 0 );
pCol->CollItem( pPar );
@@ -4383,7 +4383,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxDimArray* pArray = 0;
if( xObj->ISA(SbxDimArray) )
{
- SbxBase* pObj = (SbxBase*)xObj;
+ SbxBase* pObj = static_cast<SbxBase*>(xObj);
pArray = static_cast<SbxDimArray*>(pObj);
short nDims = pArray->GetDims();
@@ -4427,7 +4427,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
}
- SbxDimArray* pOldArray = static_cast<SbxDimArray*>((SbxArray*)refRedimpArray);
+ SbxDimArray* pOldArray = static_cast<SbxDimArray*>(static_cast<SbxArray*>(refRedimpArray));
if( pArray && pOldArray )
{
short nDimsNew = pArray->GetDims();
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index 18b3c6ae2658..8f2e5e25a86a 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -204,7 +204,7 @@ void SbxArray::Put32( SbxVariable* pVar, sal_uInt32 nIdx )
if( eType != SbxOBJECT || pVar->GetClass() != SbxCLASS_OBJECT )
pVar->Convert( eType );
SbxVariableRef& rRef = GetRef32( nIdx );
- if( (SbxVariable*) rRef != pVar )
+ if( static_cast<SbxVariable*>(rRef) != pVar )
{
rRef = pVar;
SetFlag( SBX_MODIFIED );
@@ -224,7 +224,7 @@ void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
if( eType != SbxOBJECT || pVar->GetClass() != SbxCLASS_OBJECT )
pVar->Convert( eType );
SbxVariableRef& rRef = GetRef( nIdx );
- if( (SbxVariable*) rRef != pVar )
+ if( static_cast<SbxVariable*>(rRef) != pVar )
{
rRef = pVar;
SetFlag( SBX_MODIFIED );
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index 1afee5726b89..4ece552bdf3b 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -92,7 +92,7 @@ static SbxVariable* QualifiedName
{
// It follows still an objectelement. The current element
// had to be a SBX-Object or had to deliver such an object!
- pObj = PTR_CAST(SbxObject,(SbxVariable*) refVar);
+ pObj = PTR_CAST(SbxObject,static_cast<SbxVariable*>(refVar));
if( !pObj )
// Then it had to deliver an object
pObj = PTR_CAST(SbxObject,refVar->GetObject());
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index badea10bbdd1..69a552cca1b4 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -356,7 +356,7 @@ SbxArray* SbxObject::FindVar( SbxVariable* pVar, sal_uInt16& nArrayIdx )
for( sal_uInt16 i = 0; i < pArray->Count(); i++ )
{
SbxVariableRef& rRef = pArray->GetRef( i );
- if( (SbxVariable*) rRef == pOld )
+ if( static_cast<SbxVariable*>(rRef) == pOld )
{
nArrayIdx = i; break;
}
@@ -549,7 +549,7 @@ void SbxObject::Remove( SbxVariable* pVar )
{
EndListening( pVar_->GetBroadcaster(), true );
}
- if( (SbxVariable*) pVar_ == pDfltProp )
+ if( static_cast<SbxVariable*>(pVar_) == pDfltProp )
{
pDfltProp = NULL;
}
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 4511a3fc87ff..5323d87cd98b 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -257,8 +257,8 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const
// could be affected if another value should be assigned.
// Therefore with flag.
if( bObjInObjError && !pDflt &&
- ((SbxValue*) pObj)->aData.eType == SbxOBJECT &&
- ((SbxValue*) pObj)->aData.pObj == pObj )
+ static_cast<SbxValue*>(pObj)->aData.eType == SbxOBJECT &&
+ static_cast<SbxValue*>(pObj)->aData.pObj == pObj )
{
#if !HAVE_FEATURE_SCRIPTING
const bool bSuccess = false;
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index ab47f0146db2..2327b13269a7 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2816,7 +2816,7 @@ void SAL_CALL SfxLibraryContainer::addContainerListener( const Reference< XConta
throw (RuntimeException, std::exception)
{
LibraryContainerMethodGuard aGuard( *this );
- maNameContainer.setEventSource( static_cast< XInterface* >( (OWeakObject*)this ) );
+ maNameContainer.setEventSource( static_cast< XInterface* >( static_cast<OWeakObject*>(this) ) );
maNameContainer.addContainerListener( xListener );
}
@@ -3254,7 +3254,7 @@ Sequence< sal_Int8 > SfxLibrary::getImplementationId()
void SAL_CALL SfxLibrary::addContainerListener( const Reference< XContainerListener >& xListener )
throw (RuntimeException, std::exception)
{
- maNameContainer.setEventSource( static_cast< XInterface* >( (OWeakObject*)this ) );
+ maNameContainer.setEventSource( static_cast< XInterface* >( static_cast<OWeakObject*>(this) ) );
maNameContainer.addContainerListener( xListener );
}
@@ -3268,7 +3268,7 @@ void SAL_CALL SfxLibrary::removeContainerListener( const Reference< XContainerLi
void SAL_CALL SfxLibrary::addChangesListener( const Reference< XChangesListener >& xListener )
throw (RuntimeException, std::exception)
{
- maNameContainer.setEventSource( static_cast< XInterface* >( (OWeakObject*)this ) );
+ maNameContainer.setEventSource( static_cast< XInterface* >( static_cast<OWeakObject*>(this) ) );
maNameContainer.addChangesListener( xListener );
}
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index ae1b9bf4e78e..9e9388c5a02f 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -365,7 +365,7 @@ void SAL_CALL SfxScriptLibraryContainer::importFromOldStorage( const OUString& a
tools::SvRef<SotStorage> xStorage = new SotStorage( false, aFile );
if( xStorage.Is() && xStorage->GetError() == ERRCODE_NONE )
{
- BasicManager* pBasicManager = new BasicManager( *(SotStorage*)xStorage, aFile );
+ BasicManager* pBasicManager = new BasicManager( *static_cast<SotStorage*>(xStorage), aFile );
// Set info
LibraryContainerInfo aInfo( this, NULL, static_cast< OldBasicPassword* >( this ) );