summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2015-09-28 11:42:43 +0200
committerOliver Specht <oliver.specht@cib.de>2015-09-29 12:26:20 +0000
commitd3c7c9ea81ee7c617f8cee5b645621088aea215b (patch)
tree116b8534291360181d80a53554c930caf186f15e /basic
parent2bce2365e7d411c1673e709eb1abc89da9f651dc (diff)
tdf#94559: first step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in avmedia, basctl, basic, cui, dbaccess, vcl,xmloff Change-Id: If4496762e82e896b6fbc362e6626502703c245f5 Reviewed-on: https://gerrit.libreoffice.org/18905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basmgr.cxx12
-rw-r--r--basic/source/classes/eventatt.cxx10
-rw-r--r--basic/source/classes/sb.cxx40
-rw-r--r--basic/source/classes/sbunoobj.cxx76
-rw-r--r--basic/source/classes/sbxmod.cxx78
-rw-r--r--basic/source/comp/sbcomp.cxx12
-rw-r--r--basic/source/runtime/dllmgr-none.cxx2
-rw-r--r--basic/source/runtime/dllmgr-x64.cxx12
-rw-r--r--basic/source/runtime/dllmgr-x86.cxx12
-rw-r--r--basic/source/runtime/methods.cxx14
-rw-r--r--basic/source/runtime/methods1.cxx26
-rw-r--r--basic/source/runtime/runtime.cxx90
-rw-r--r--basic/source/sbx/sbxbool.cxx4
-rw-r--r--basic/source/sbx/sbxbyte.cxx4
-rw-r--r--basic/source/sbx/sbxchar.cxx4
-rw-r--r--basic/source/sbx/sbxcoll.cxx4
-rw-r--r--basic/source/sbx/sbxcurr.cxx4
-rw-r--r--basic/source/sbx/sbxdate.cxx4
-rw-r--r--basic/source/sbx/sbxdbl.cxx4
-rw-r--r--basic/source/sbx/sbxdec.cxx4
-rw-r--r--basic/source/sbx/sbxexec.cxx4
-rw-r--r--basic/source/sbx/sbxint.cxx12
-rw-r--r--basic/source/sbx/sbxlng.cxx4
-rw-r--r--basic/source/sbx/sbxobj.cxx22
-rw-r--r--basic/source/sbx/sbxsng.cxx4
-rw-r--r--basic/source/sbx/sbxstr.cxx6
-rw-r--r--basic/source/sbx/sbxuint.cxx4
-rw-r--r--basic/source/sbx/sbxulng.cxx4
-rw-r--r--basic/source/sbx/sbxvalue.cxx22
-rw-r--r--basic/source/sbx/sbxvar.cxx2
30 files changed, 252 insertions, 248 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 28b48c2e2fe9..f7db9707f08f 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1078,7 +1078,7 @@ bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) con
bool bLoaded = false;
if( xNew.Is() )
{
- if( xNew->IsA( TYPE(StarBASIC) ) )
+ if( 0 != dynamic_cast<const StarBASIC*>( &xNew ) )
{
StarBASIC* pNew = static_cast<StarBASIC*>(static_cast<SbxBase*>(xNew));
// Use the Parent of the old BASICs
@@ -1983,7 +1983,7 @@ sal_Bool DialogContainer_Impl::hasElements()
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
{
SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
- if ( pVar->ISA( SbxObject ) && ( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) )
+ if ( 0 != dynamic_cast<const SbxObject*>( pVar) && ( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) )
{
bRet = true;
break;
@@ -1997,7 +1997,7 @@ uno::Any DialogContainer_Impl::getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
{
SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
- if( !( pVar && pVar->ISA( SbxObject ) &&
+ if( !( pVar && 0 != dynamic_cast<const SbxObject*>( pVar) &&
( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) ) )
{
throw container::NoSuchElementException();
@@ -2023,7 +2023,7 @@ uno::Sequence< OUString > DialogContainer_Impl::getElementNames()
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
{
SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
- if ( pVar->ISA( SbxObject ) && ( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) )
+ if ( 0 != dynamic_cast<const SbxObject*>( pVar) && ( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) )
{
pRetSeq[ nDialogCounter ] = OUString( pVar->GetName() );
nDialogCounter++;
@@ -2038,7 +2038,7 @@ sal_Bool DialogContainer_Impl::hasByName( const OUString& aName )
{
bool bRet = false;
SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
- if( pVar && pVar->ISA( SbxObject ) &&
+ if( pVar && 0 != dynamic_cast<const SbxObject*>( pVar) &&
( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) )
{
bRet = true;
@@ -2078,7 +2078,7 @@ void DialogContainer_Impl::removeByName( const OUString& Name )
{
(void)Name;
SbxVariable* pVar = mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE );
- if( !( pVar && pVar->ISA( SbxObject ) &&
+ if( !( pVar && 0 != dynamic_cast<const SbxObject*>( pVar) &&
( static_cast<SbxObject*>(pVar)->GetSbxId() == SBXID_DIALOG ) ) )
{
throw container::NoSuchElementException();
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 2744f44024c5..f73d8055d25e 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -265,7 +265,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
else
{
SbxVariable* pVar = xLibSearchBasic->GetObjects()->Get( nObj );
- pBasic = PTR_CAST(StarBASIC,pVar);
+ pBasic = dynamic_cast<StarBASIC*>( pVar );
}
if( pBasic )
{
@@ -284,11 +284,11 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
}
// Default: Be tolerant and search everywhere
- if( (!pMethVar || !pMethVar->ISA(SbMethod)) && maBasicRef.Is() )
+ if( (!pMethVar || 0 == dynamic_cast<const SbMethod*>( pMethVar)) && maBasicRef.Is() )
{
pMethVar = maBasicRef->FindQualified( aMacro, SbxCLASS_DONTCARE );
}
- SbMethod* pMeth = PTR_CAST(SbMethod,pMethVar);
+ SbMethod* pMeth = dynamic_cast<SbMethod*>( pMethVar );
if( !pMeth )
{
return;
@@ -333,7 +333,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog
css::uno::Reference< css::container::XNameContainer > aRetDlgLib;
SbxVariable* pDlgLibContVar = pBasic->Find(OUString("DialogLibraries"), SbxCLASS_OBJECT);
- if( pDlgLibContVar && pDlgLibContVar->ISA(SbUnoObject) )
+ if( pDlgLibContVar && 0 != dynamic_cast<const SbUnoObject*>( pDlgLibContVar) )
{
SbUnoObject* pDlgLibContUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pDlgLibContVar));
Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny();
@@ -432,7 +432,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
// Get dialog
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj && pObj->ISA(SbUnoObject)) )
+ if( !(pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj )) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 2dc69d6a2c29..31e918843ed5 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -217,7 +217,7 @@ StarBASIC* lclGetDocBasicForModule( SbModule* pModule )
while( pCurParent->GetParent() != NULL )
{
pCurParent = pCurParent->GetParent();
- StarBASIC* pDocBasic = PTR_CAST( StarBASIC, pCurParent );
+ StarBASIC* pDocBasic = dynamic_cast<StarBASIC*>( pCurParent );
if( pDocBasic != NULL && pDocBasic->IsDocBasic() )
{
pRetBasic = pDocBasic;
@@ -508,7 +508,7 @@ SbxObject* SbFormFactory::CreateObject( const OUString& rClassName )
{
if( SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT ) )
{
- if( SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pVar->GetObject() ) )
+ if( SbUserFormModule* pFormModule = dynamic_cast<SbUserFormModule*>( pVar->GetObject() ) )
{
bool bInitState = pFormModule->getInitState();
if( bInitState )
@@ -544,7 +544,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
for( sal_uInt32 i = 0 ; i < nCount ; i++ )
{
SbxVariable* pVar = pProps->Get32( i );
- SbxProperty* pProp = PTR_CAST( SbxProperty, pVar );
+ SbxProperty* pProp = dynamic_cast<SbxProperty*>( pVar );
if( pProp )
{
SbxProperty* pNewProp = new SbxProperty( *pProp );
@@ -552,7 +552,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( eVarType & SbxARRAY )
{
SbxBase* pParObj = pVar->GetObject();
- SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pSource = dynamic_cast<SbxDimArray*>( pParObj );
SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
pDest->setHasFixedSize( pSource && pSource->hasFixedSize() );
@@ -580,7 +580,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( eVarType == SbxOBJECT )
{
SbxBase* pObjBase = pVar->GetObject();
- SbxObject* pSrcObj = PTR_CAST(SbxObject,pObjBase);
+ SbxObject* pSrcObj = dynamic_cast<SbxObject*>( pObjBase );
SbxObject* pDestObj = NULL;
if( pSrcObj != NULL )
pDestObj = cloneTypeObjectImpl( *pSrcObj );
@@ -654,10 +654,10 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbxVariable* pVar = pClassMethods->Get32( i );
// Exclude SbIfaceMapperMethod to copy them in a second step
- SbIfaceMapperMethod* pIfaceMethod = PTR_CAST( SbIfaceMapperMethod, pVar );
+ SbIfaceMapperMethod* pIfaceMethod = dynamic_cast<SbIfaceMapperMethod*>( pVar );
if( !pIfaceMethod )
{
- SbMethod* pMethod = PTR_CAST(SbMethod, pVar );
+ SbMethod* pMethod = dynamic_cast<SbMethod*>( pVar );
if( pMethod )
{
SbxFlagBits nFlags_ = pMethod->GetFlags();
@@ -679,7 +679,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
{
SbxVariable* pVar = pClassMethods->Get32( i );
- SbIfaceMapperMethod* pIfaceMethod = PTR_CAST( SbIfaceMapperMethod, pVar );
+ SbIfaceMapperMethod* pIfaceMethod = dynamic_cast<SbIfaceMapperMethod*>( pVar );
if( pIfaceMethod )
{
SbMethod* pImplMethod = pIfaceMethod->getImplMethod();
@@ -691,7 +691,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
// Search for own copy of ImplMethod
SbxVariable* p = pMethods->Find( pImplMethod->GetName(), SbxCLASS_METHOD );
- SbMethod* pImplMethodCopy = p ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pImplMethodCopy = p ? dynamic_cast<SbMethod*>( p ) : NULL;
if( !pImplMethodCopy )
{
OSL_FAIL( "Found no ImplMethod copy" );
@@ -709,7 +709,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
for( i = 0 ; i < nPropertyCount ; i++ )
{
SbxVariable* pVar = pClassProps->Get32( i );
- SbProcedureProperty* pProcedureProp = PTR_CAST( SbProcedureProperty, pVar );
+ SbProcedureProperty* pProcedureProp = dynamic_cast<SbProcedureProperty*>( pVar );
if( pProcedureProp )
{
SbxFlagBits nFlags_ = pProcedureProp->GetFlags();
@@ -724,7 +724,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
}
else
{
- SbxProperty* pProp = PTR_CAST( SbxProperty, pVar );
+ SbxProperty* pProp = dynamic_cast<SbxProperty*>( pVar );
if( pProp )
{
SbxFlagBits nFlags_ = pProp->GetFlags();
@@ -737,12 +737,12 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
if( eVarType == SbxOBJECT )
{
SbxBase* pObjBase = pProp->GetObject();
- SbxObject* pObj = PTR_CAST(SbxObject,pObjBase);
+ SbxObject* pObj = dynamic_cast<SbxObject*>( pObjBase );
if( pObj != NULL )
{
OUString aObjClass = pObj->GetClassName();
- SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase);
+ SbClassModuleObject* pClassModuleObj = dynamic_cast<SbClassModuleObject*>( pObjBase );
if( pClassModuleObj != NULL )
{
SbModule* pLclClassModule = pClassModuleObj->getClassModule();
@@ -800,7 +800,7 @@ SbxVariable* SbClassModuleObject::Find( const OUString& rName, SbxClassType t )
{
triggerInitializeEvent();
- SbIfaceMapperMethod* pIfaceMapperMethod = PTR_CAST(SbIfaceMapperMethod,pRes);
+ SbIfaceMapperMethod* pIfaceMapperMethod = dynamic_cast<SbIfaceMapperMethod*>( pRes );
if( pIfaceMapperMethod )
{
pRes = pIfaceMapperMethod->getImplMethod();
@@ -1045,7 +1045,7 @@ void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic )
for( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
if( pBasic && pBasic != pDeletedBasic )
{
pBasic->implClearDependingVarsOnDelete( pDeletedBasic );
@@ -1284,7 +1284,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
if( pBasic && pBasic != pBasicNotToInit )
{
pBasic->InitAllModules();
@@ -1300,7 +1300,7 @@ void StarBASIC::DeInitAllModules()
for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ )
{
SbModule* pModule = static_cast<SbModule*>(pModules->Get( nMod ));
- if( pModule->pImage && !pModule->isProxyModule() && !pModule->ISA(SbObjModule) )
+ if( pModule->pImage && !pModule->isProxyModule() && 0 == dynamic_cast<const SbObjModule*>( pModule) )
{
pModule->pImage->bInit = false;
}
@@ -1309,7 +1309,7 @@ void StarBASIC::DeInitAllModules()
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
if( pBasic )
{
pBasic->DeInitAllModules();
@@ -1892,7 +1892,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
for( nObj = 0 ; nObj < nObjCount ; nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST( StarBASIC, pVar );
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
ppDeleteTab[nObj] = pBasic ? NULL : pVar;
}
for( nObj = 0 ; nObj < nObjCount ; nObj++ )
@@ -1924,7 +1924,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
{
return false;
}
- else if( pMod->ISA(SbJScriptModule) )
+ else if( 0 != dynamic_cast<const SbJScriptModule*>( pMod) )
{
// assign Ref, so that pMod will be deleted
SbModuleRef xRef = pMod;
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index c7a95f1bb4be..c3a9cc5c102c 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -135,15 +135,15 @@ SbxVariable* getDefaultProp( SbxVariable* pRef )
SbxVariable* pDefaultProp = NULL;
if ( pRef->GetType() == SbxOBJECT )
{
- SbxObject* pObj = PTR_CAST(SbxObject, pRef);
+ SbxObject* pObj = dynamic_cast<SbxObject*>( pRef );
if ( !pObj )
{
SbxBase* pObjVarObj = pRef->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast<SbxObject*>( pObjVarObj );
}
- if ( pObj && pObj->ISA(SbUnoObject) )
+ if ( pObj && 0 != dynamic_cast<const SbUnoObject*>( pObj) )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
pDefaultProp = pUnoObj->GetDfltProperty();
}
}
@@ -152,7 +152,7 @@ SbxVariable* getDefaultProp( SbxVariable* pRef )
void SetSbUnoObjectDfltPropName( SbxObject* pObj )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject, pObj);
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
if ( pUnoObj )
{
OUString sDfltPropName;
@@ -879,7 +879,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
return aRetType;
}
- if( xObj->ISA(SbxDimArray) )
+ if( 0 != dynamic_cast<const SbxDimArray*>( &xObj) )
{
SbxBase* pObj = static_cast<SbxBase*>(xObj);
SbxDimArray* pArray = static_cast<SbxDimArray*>(pObj);
@@ -973,12 +973,12 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
}
}
// No array, but ...
- else if( xObj->ISA(SbUnoObject) )
+ else if( 0 != dynamic_cast<const SbUnoObject*>( &xObj) )
{
aRetType = static_cast<SbUnoObject*>(static_cast<SbxBase*>(xObj))->getUnoAny().getValueType();
}
// SbUnoAnyObject?
- else if( xObj->ISA(SbUnoAnyObject) )
+ else if( 0 != dynamic_cast<const SbUnoAnyObject*>( &xObj) )
{
aRetType = static_cast<SbUnoAnyObject*>(static_cast<SbxBase*>(xObj))->getValue().getValueType();
}
@@ -1001,9 +1001,9 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
SbxBaseRef xObj = pVar->GetObject();
if( xObj.Is() )
{
- if( xObj->ISA(SbUnoAnyObject) )
+ if( 0 != dynamic_cast<const SbUnoAnyObject*>( &xObj) )
return static_cast<SbUnoAnyObject*>(static_cast<SbxBase*>(xObj))->getValue();
- if( xObj->ISA(SbClassModuleObject) )
+ if( 0 != dynamic_cast<const SbClassModuleObject*>( &xObj) )
{
Any aRetAny;
SbClassModuleObject* pClassModuleObj = static_cast<SbClassModuleObject*>(static_cast<SbxBase*>(xObj));
@@ -1011,10 +1011,10 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
return aRetAny;
}
- if( !xObj->ISA(SbUnoObject) )
+ if( 0 == dynamic_cast<const SbUnoObject*>( &xObj) )
{
// Create NativeObjectWrapper to identify object in case of callbacks
- SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject());
+ SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() );
if( pObj != NULL )
{
NativeObjectWrapper aNativeObjectWrapper;
@@ -1201,7 +1201,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
if( eBaseType == SbxOBJECT )
{
SbxBaseRef xObj = pVar->GetObject();
- if( xObj.Is() && xObj->ISA(SbUnoAnyObject) )
+ if( xObj.Is() && 0 != dynamic_cast<const SbUnoAnyObject*>( &xObj) )
{
return static_cast<SbUnoAnyObject*>(static_cast<SbxBase*>(xObj))->getValue();
}
@@ -1256,11 +1256,11 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
}
SbxBaseRef pObj = pVar->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj) )
{
aRetVal = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
}
- else if( pObj && pObj->ISA(SbUnoStructRefObject) )
+ else if( pObj && 0 != dynamic_cast<const SbUnoStructRefObject*>( &pObj) )
{
aRetVal = static_cast<SbUnoStructRefObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
}
@@ -1282,7 +1282,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
Reference< XIdlClass > xIdlClass;
SbxBaseRef pObj = pVar->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj) )
{
Any aUnoAny = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
aUnoAny >>= xIdlClass;
@@ -1318,7 +1318,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
case TypeClass_SEQUENCE:
{
SbxBaseRef xObj = pVar->GetObject();
- if( xObj && xObj->ISA(SbxDimArray) )
+ if( xObj && 0 != dynamic_cast<const SbxDimArray*>( &xObj) )
{
SbxBase* pObj = static_cast<SbxBase*>(xObj);
SbxDimArray* pArray = static_cast<SbxDimArray*>(pObj);
@@ -1480,7 +1480,7 @@ void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, bool bOL
{
AutomationNamedArgsSbxArray* pArgNamesArray = NULL;
if( bOLEAutomation )
- pArgNamesArray = PTR_CAST(AutomationNamedArgsSbxArray,pParams);
+ pArgNamesArray = dynamic_cast<AutomationNamedArgsSbxArray*>( pParams );
args.realloc( nParamCount );
Any* pAnyArgs = args.getArray();
@@ -1654,8 +1654,8 @@ OUString getBasicObjectTypeName( SbxObject* pObj )
OUString aName;
if( pObj )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
- SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
+ SbUnoStructRefObject* pUnoStructObj = dynamic_cast<SbUnoStructRefObject*>( pObj );
if( pUnoObj )
aName = getDbgObjectNameImpl( pUnoObj );
else if ( pUnoStructObj )
@@ -2033,8 +2033,8 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
SbxVariable* pVar = pHint->GetVar();
SbxArray* pParams = pVar->GetParameters();
- SbUnoProperty* pProp = PTR_CAST(SbUnoProperty,pVar);
- SbUnoMethod* pMeth = PTR_CAST(SbUnoMethod,pVar);
+ SbUnoProperty* pProp = dynamic_cast<SbUnoProperty*>( pVar );
+ SbUnoMethod* pMeth = dynamic_cast<SbUnoMethod*>( pVar );
if( pProp )
{
bool bInvocation = pProp->isInvocationBased();
@@ -2946,8 +2946,8 @@ void createAllObjectProperties( SbxObject* pObj )
if( !pObj )
return;
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
- SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
+ SbUnoStructRefObject* pUnoStructObj = dynamic_cast<SbUnoStructRefObject*>( pObj );
if( pUnoObj )
{
pUnoObj->createAllProperties();
@@ -3127,7 +3127,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
// get the Uno-Object
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj && pObj->ISA(SbUnoObject)) )
+ if( !(pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj)) )
{
return;
}
@@ -3193,7 +3193,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj && pObj->ISA(SbUnoObject)) )
+ if( !(pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj)) )
{
return;
}
@@ -3228,7 +3228,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
SbxBaseRef pObj1 = xParam1->GetObject();
- if( !(pObj1 && pObj1->ISA(SbUnoObject)) )
+ if( !(pObj1 && 0 != dynamic_cast<const SbUnoObject*>( &pObj1 )) )
{
return;
}
@@ -3247,7 +3247,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
SbxBaseRef pObj2 = xParam2->GetObject();
- if( !(pObj2 && pObj2->ISA(SbUnoObject)) )
+ if( !(pObj2 && 0 != dynamic_cast<const SbUnoObject*>( &pObj2 )) )
{
return;
}
@@ -3613,7 +3613,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
SbxVariable* pVar = pHint->GetVar();
SbxArray* pParams = pVar->GetParameters();
- SbUnoServiceCtor* pUnoCtor = PTR_CAST(SbUnoServiceCtor,pVar);
+ SbUnoServiceCtor* pUnoCtor = dynamic_cast<SbUnoServiceCtor*>( pVar );
if( pUnoCtor && pHint->GetId() == SBX_HINT_DATAWANTED )
{
// Parameter count -1 because of Param0 == this
@@ -3926,7 +3926,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet
while( pP->GetParent() )
{
pP = pP->GetParent();
- StarBASIC * pLib = PTR_CAST(StarBASIC,pP);
+ StarBASIC * pLib = dynamic_cast<StarBASIC*>( pP );
if( pLib )
{
// Create in a Basic Array
@@ -4257,7 +4257,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
Reference< XIdlClass > xIdlClass;
SbxBaseRef pObj = pVal->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj) )
{
Any aUnoAny = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj))->getUnoAny();
aUnoAny >>= xIdlClass;
@@ -4353,7 +4353,7 @@ ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObject
, m_xScopeObj( xScopeObj )
, m_aListeners( m_aMutex )
{
- m_bProxyIsClassModuleObject = xScopeObj.Is() && xScopeObj->ISA(SbClassModuleObject);
+ m_bProxyIsClassModuleObject = xScopeObj.Is() && 0 != dynamic_cast<const SbClassModuleObject*>( &xScopeObj );
}
Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection() throw(std::exception)
@@ -4374,7 +4374,7 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A
aPropertyFunctionName += rProperty;
SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD );
- SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p != NULL ? dynamic_cast<SbMethod*>( p ) : NULL;
if( pMeth == NULL )
{
// TODO: Check vba behavior concernig missing function
@@ -4414,7 +4414,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue(const OUString& rProperty)
aPropertyFunctionName += rProperty;
SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD );
- SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p != NULL ? dynamic_cast<SbMethod*>( p ) : NULL;
if( pMeth == NULL )
{
// TODO: Check vba behavior concernig missing function
@@ -4471,7 +4471,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
}
SbxVariable* p = xScopeObj->Find( aFunctionName, SbxCLASS_METHOD );
- SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p != NULL ? dynamic_cast<SbMethod*>( p ) : NULL;
if( pMeth == NULL )
{
// TODO: Check vba behavior concernig missing function
@@ -4718,7 +4718,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
do
{
SbxObject* pObjParent = pCurObject->GetParent();
- pParentBasic = PTR_CAST( StarBASIC, pObjParent );
+ pParentBasic = dynamic_cast<StarBASIC*>( pObjParent );
pCurObject = pObjParent;
}
while( pParentBasic == NULL && pCurObject != NULL );
@@ -4745,7 +4745,7 @@ bool handleToStringForCOMObjects( SbxObject* pObj, SbxValue* pVal )
bool bSuccess = false;
SbUnoObject* pUnoObj = NULL;
- if( pObj != NULL && (pUnoObj = PTR_CAST(SbUnoObject,pObj)) != NULL )
+ if( pObj != NULL && (pUnoObj = dynamic_cast<SbUnoObject*>( pObj)) != NULL )
{
// Only for native COM objects
if( pUnoObj->isNativeCOMObject() )
@@ -4995,7 +4995,7 @@ void SbUnoStructRefObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
- SbUnoProperty* pProp = PTR_CAST(SbUnoProperty,pVar);
+ SbUnoProperty* pProp = dynamic_cast<SbUnoProperty*>( pVar );
if( pProp )
{
StructFieldInfo::iterator it = maFields.find( pProp->GetName() );
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 4b0e27242400..ed13469e3e69 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -122,13 +122,13 @@ public:
DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pVar->GetName() )
{
- SbObjModule* pMod = PTR_CAST(SbObjModule,pVar);
+ SbObjModule* pMod = dynamic_cast<SbObjModule*>( pVar );
if ( pMod )
{
if ( pMod->GetModuleType() == ModuleType::DOCUMENT )
{
// Use proxy factory service to create aggregatable proxy.
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pMod->GetObject() );
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pMod->GetObject() );
Reference< XInterface > xIf;
if ( pUnoObj )
{
@@ -538,13 +538,13 @@ void SbModule::StartDefinitions()
sal_uInt16 i;
for( i = 0; i < pMethods->Count(); i++ )
{
- SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) );
+ SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
if( p )
p->bInvalid = true;
}
for( i = 0; i < pProps->Count(); )
{
- SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) );
+ SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get( i ) );
if( p )
pProps->Remove( i );
else
@@ -557,7 +557,7 @@ void SbModule::StartDefinitions()
SbMethod* SbModule::GetMethod( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
- SbMethod* pMeth = p ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p ? dynamic_cast<SbMethod*>( p ) : NULL;
if( p && !pMeth )
{
pMethods->Remove( p );
@@ -589,7 +589,7 @@ SbMethod* SbModule::GetMethod( const OUString& rName, SbxDataType t )
SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
- SbProperty* pProp = p ? PTR_CAST(SbProperty,p) : NULL;
+ SbProperty* pProp = p ? dynamic_cast<SbProperty*>( p ) : NULL;
if( p && !pProp )
{
pProps->Remove( p );
@@ -608,7 +608,7 @@ SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t )
SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
- SbProcedureProperty* pProp = p ? PTR_CAST(SbProcedureProperty,p) : NULL;
+ SbProcedureProperty* pProp = p ? dynamic_cast<SbProcedureProperty*>( p ) : NULL;
if( p && !pProp )
{
pProps->Remove( p );
@@ -627,7 +627,7 @@ SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxD
SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
- SbIfaceMapperMethod* pMapperMethod = p ? PTR_CAST(SbIfaceMapperMethod,p) : NULL;
+ SbIfaceMapperMethod* pMapperMethod = p ? dynamic_cast<SbIfaceMapperMethod*>( p ) : NULL;
if( p && !pMapperMethod )
{
pMethods->Remove( p );
@@ -656,7 +656,7 @@ void SbModule::EndDefinitions( bool bNewState )
{
for( sal_uInt16 i = 0; i < pMethods->Count(); )
{
- SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) );
+ SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
if( p )
{
if( p->bInvalid )
@@ -703,7 +703,7 @@ SbxVariable* SbModule::Find( const OUString& rName, SbxClassType t )
if( xArray.Is() )
{
SbxVariable* pEnumVar = xArray->Find( rName, SbxCLASS_DONTCARE );
- SbxObject* pEnumObject = PTR_CAST( SbxObject, pEnumVar );
+ SbxObject* pEnumObject = dynamic_cast<SbxObject*>( pEnumVar );
if( pEnumObject )
{
bool bPrivate = pEnumObject->IsSet( SbxFlagBits::Private );
@@ -744,9 +744,9 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
- SbProperty* pProp = PTR_CAST(SbProperty,pVar);
- SbMethod* pMeth = PTR_CAST(SbMethod,pVar);
- SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
+ SbProperty* pProp = dynamic_cast<SbProperty*>( pVar );
+ SbMethod* pMeth = dynamic_cast<SbMethod*>( pVar );
+ SbProcedureProperty* pProcProperty = dynamic_cast<SbProcedureProperty*>( pVar );
if( pProcProperty )
{
@@ -972,7 +972,7 @@ static void _SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p )
{
SbxVariable* pVar = pObjs->Get( i );
if( pVar->IsA( TYPE(SbxObject) ) )
- _SendHint( PTR_CAST(SbxObject,pVar), nId, p );
+ _SendHint( dynamic_cast<SbxObject*>( pVar), nId, p );
}
}
@@ -1017,7 +1017,7 @@ void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic )
for( sal_uInt16 i = 0 ; i < nCount ; i++ )
{
SbxVariable* pObjVar = pObjs->Get( i );
- StarBASIC* pSubBasic = PTR_CAST( StarBASIC, pObjVar );
+ StarBASIC* pSubBasic = dynamic_cast<StarBASIC*>( pObjVar );
if( pSubBasic )
{
ClearUnoObjectsInRTL_Impl_Rek( pSubBasic );
@@ -1103,7 +1103,7 @@ void SbModule::Run( SbMethod* pMeth )
SbxBase::ResetError();
if( pMSOMacroRuntimeLibVar )
{
- StarBASIC* pMSOMacroRuntimeLib = PTR_CAST(StarBASIC,pMSOMacroRuntimeLibVar);
+ StarBASIC* pMSOMacroRuntimeLib = dynamic_cast<StarBASIC*>( pMSOMacroRuntimeLibVar );
if( pMSOMacroRuntimeLib )
{
SbxFlagBits nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SbxFlagBits::GlobalSearch;
@@ -1246,7 +1246,7 @@ void SbModule::Run( SbMethod* pMeth )
StarBASIC::FatalError( ERRCODE_BASIC_STACK_OVERFLOW );
}
- StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( GetParent() );
if( bDelInst )
{
// #57841 Clear Uno-Objects, which were helt in RTL functions,
@@ -1328,18 +1328,18 @@ void SbModule::ClearPrivateVars()
{
for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ )
{
- SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) );
+ SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get( i ) );
if( p )
{
// Delete not the arrays, only their content
if( p->GetType() & SbxARRAY )
{
- SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject());
+ SbxArray* pArray = dynamic_cast<SbxArray*>( p->GetObject() );
if( pArray )
{
for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ )
{
- SbxVariable* pj = PTR_CAST(SbxVariable,pArray->Get( j ));
+ SbxVariable* pj = dynamic_cast<SbxVariable*>( pArray->Get( j ) );
pj->SbxValue::Clear();
}
}
@@ -1354,21 +1354,21 @@ void SbModule::ClearPrivateVars()
void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic )
{
- if( pVar->SbxValue::GetType() != SbxOBJECT || pVar->ISA( SbProcedureProperty ) )
+ if( pVar->SbxValue::GetType() != SbxOBJECT || 0 != dynamic_cast<const SbProcedureProperty*>( pVar) )
return;
- SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject());
+ SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() );
if( pObj != NULL )
{
SbxObject* p = pObj;
- SbModule* pMod = PTR_CAST( SbModule, p );
+ SbModule* pMod = dynamic_cast<SbModule*>( p );
if( pMod != NULL )
pMod->ClearVarsDependingOnDeletedBasic( pDeletedBasic );
while( (p = p->GetParent()) != NULL )
{
- StarBASIC* pBasic = PTR_CAST( StarBASIC, p );
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( p );
if( pBasic != NULL && pBasic == pDeletedBasic )
{
pVar->SbxValue::Clear();
@@ -1384,17 +1384,17 @@ void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic )
for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ )
{
- SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) );
+ SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get( i ) );
if( p )
{
if( p->GetType() & SbxARRAY )
{
- SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject());
+ SbxArray* pArray = dynamic_cast<SbxArray*>( p->GetObject() );
if( pArray )
{
for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ )
{
- SbxVariable* pVar = PTR_CAST(SbxVariable,pArray->Get( j ));
+ SbxVariable* pVar = dynamic_cast<SbxVariable*>( pArray->Get( j ) );
implClearIfVarDependsOnDeletedBasic( pVar, pDeletedBasic );
}
}
@@ -1414,7 +1414,7 @@ void StarBASIC::ClearAllModuleVars()
{
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) )
+ if( pModule->pImage && pModule->pImage->bInit && !pModule->isProxyModule() && 0 == dynamic_cast<const SbObjModule*>( pModule) )
pModule->ClearPrivateVars();
}
@@ -1435,7 +1435,7 @@ void SbModule::GlobalRunInit( bool bBasicStart )
GetSbData()->bGlobalInitErr = false;
// Parent of the module is a Basic
- StarBASIC *pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC *pBasic = dynamic_cast<StarBASIC*>( GetParent() );
if( pBasic )
{
pBasic->InitAllModules();
@@ -1443,7 +1443,7 @@ void SbModule::GlobalRunInit( bool bBasicStart )
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
{
- StarBASIC * pParentBasic = PTR_CAST(StarBASIC,pParent_);
+ StarBASIC * pParentBasic = dynamic_cast<StarBASIC*>( pParent_ );
if( pParentBasic )
{
pParentBasic->InitAllModules( pBasic );
@@ -1452,7 +1452,7 @@ void SbModule::GlobalRunInit( bool bBasicStart )
SbxObject* pParentParent = pParentBasic->GetParent();
if( pParentParent )
{
- StarBASIC * pParentParentBasic = PTR_CAST(StarBASIC,pParentParent);
+ StarBASIC * pParentParentBasic = dynamic_cast<StarBASIC*>( pParentParent );
if( pParentParentBasic )
pParentParentBasic->InitAllModules( pParentBasic );
}
@@ -1463,14 +1463,14 @@ void SbModule::GlobalRunInit( bool bBasicStart )
void SbModule::GlobalRunDeInit()
{
- StarBASIC *pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC *pBasic = dynamic_cast<StarBASIC*>( GetParent() );
if( pBasic )
{
pBasic->DeInitAllModules();
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
- pBasic = PTR_CAST(StarBASIC,pParent_);
+ pBasic = dynamic_cast<StarBASIC*>( pParent_ );
if( pBasic )
pBasic->DeInitAllModules();
}
@@ -1612,7 +1612,7 @@ SbModule::fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg ) const
pImg = pImage;
for( sal_uInt32 i = 0; i < pMethods->Count(); i++ )
{
- SbMethod* pMeth = PTR_CAST(SbMethod,pMethods->Get( (sal_uInt16)i ) );
+ SbMethod* pMeth = dynamic_cast<SbMethod*>( pMethods->Get( (sal_uInt16)i ) );
if( pMeth )
{
//fixup method start positions
@@ -1849,14 +1849,14 @@ bool SbModule::LoadCompleted()
sal_uInt16 i;
for( i = 0; i < p->Count(); i++ )
{
- SbMethod* q = PTR_CAST(SbMethod,p->Get( i ) );
+ SbMethod* q = dynamic_cast<SbMethod*>( p->Get( i ) );
if( q )
q->pMod = this;
}
p = GetProperties();
for( i = 0; i < p->Count(); i++ )
{
- SbProperty* q = PTR_CAST(SbProperty,p->Get( i ) );
+ SbProperty* q = dynamic_cast<SbProperty*>( p->Get( i ) );
if( q )
q->pMod = this;
}
@@ -1871,7 +1871,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
- SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
+ SbProcedureProperty* pProcProperty = dynamic_cast<SbProcedureProperty*>( pVar );
if( pProcProperty )
{
bDone = true;
@@ -2184,7 +2184,7 @@ SbObjModule::~SbObjModule()
void
SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException, std::exception )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,static_cast<SbxVariable*>(pDocObject));
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( static_cast<SbxVariable*>(pDocObject) );
if ( pUnoObj && pUnoObj->getUnoAny() == aObj ) // object is equal, nothing to do
return;
pDocObject = new SbUnoObject( GetName(), aObj );
@@ -2670,7 +2670,7 @@ void SbUserFormModule::InitObject()
do
{
SbxObject* pObjParent = pCurObject->GetParent();
- pParentBasic = PTR_CAST( StarBASIC, pObjParent );
+ pParentBasic = dynamic_cast<StarBASIC*>( pObjParent );
pCurObject = pObjParent;
}
while( pParentBasic == NULL && pCurObject != NULL );
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index 491fa2ca585c..96ec24c7dbd1 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -545,7 +545,7 @@ void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl )
GnLastCallLvl = nCallLvl;
SbModule* pTraceMod = pModule;
- if( pTraceMod->ISA(SbClassModuleObject) )
+ if( 0 != dynamic_cast<const SbClassModuleObject*>( pTraceMod) )
{
SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
pTraceMod = pClassModuleObj->getClassModule();
@@ -654,7 +654,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallL
SbModule* pTraceMod = pModule;
SbClassModuleObject* pClassModuleObj = NULL;
- if( pTraceMod->ISA(SbClassModuleObject) )
+ if( 0 != dynamic_cast<const SbClassModuleObject*>( pTraceMod) )
{
pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
pTraceMod = pClassModuleObj->getClassModule();
@@ -935,7 +935,7 @@ bool SbModule::Compile()
{
if( pImage )
return true;
- StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC* pBasic = dynamic_cast<StarBASIC*>( GetParent() );
if( !pBasic )
return false;
SbxBase::ResetError();
@@ -959,13 +959,13 @@ bool SbModule::Compile()
bool bRet = IsCompiled();
if( bRet )
{
- if( !this->ISA(SbObjModule) )
+ if( 0 == dynamic_cast<const SbObjModule*>( this) )
pBasic->ClearAllModuleVars();
RemoveVars(); // remove 'this' Modules variables
// clear all method statics
for( sal_uInt16 i = 0; i < pMethods->Count(); i++ )
{
- SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) );
+ SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
if( p )
p->ClearStatics();
}
@@ -975,7 +975,7 @@ bool SbModule::Compile()
{
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
- pBasic = PTR_CAST(StarBASIC,pParent_);
+ pBasic = dynamic_cast<StarBASIC*>( pParent_ );
if( pBasic )
pBasic->ClearAllModuleVars();
}
diff --git a/basic/source/runtime/dllmgr-none.cxx b/basic/source/runtime/dllmgr-none.cxx
index 90d628dcd429..3d720bb54e62 100644
--- a/basic/source/runtime/dllmgr-none.cxx
+++ b/basic/source/runtime/dllmgr-none.cxx
@@ -57,7 +57,7 @@ SbError returnInt64InOutArg(SbxArray *pArgs, SbxVariable &rRetVal,
if (pOut->IsObject())
{
// FIXME: should we clone this and use pOut->PutObject ?
- SbxObject* pObj = PTR_CAST(SbxObject,pOut->GetObject());
+ SbxObject* pObj = dynamic_cast<SbxObject*>( pOut->GetObject() );
if (!pObj)
return ERRCODE_BASIC_BAD_ARGUMENT;
diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx
index 5239e547fa8b..78fb890f9446 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -154,7 +154,7 @@ std::size_t alignment(SbxVariable * variable) {
case SbxOBJECT:
{
std::size_t n = 1;
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
n = std::max(n, alignment(props->Get(i)));
@@ -169,7 +169,7 @@ std::size_t alignment(SbxVariable * variable) {
return 1;
}
} else {
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
for (int i = 0; i < dims; ++i) {
@@ -205,7 +205,7 @@ SbError marshalStruct(
MarshalData & data)
{
OSL_ASSERT(variable != 0);
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
SbError e = marshal(false, props->Get(i), false, blob, offset, data);
@@ -221,7 +221,7 @@ SbError marshalArray(
MarshalData & data)
{
OSL_ASSERT(variable != 0);
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
@@ -391,7 +391,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
align(
reinterpret_cast< sal_uIntPtr >(data),
alignment(variable)));
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
data = unmarshal(props->Get(i), data);
@@ -409,7 +409,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
break;
}
} else {
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx
index d955b121dc1f..2c32b4aa0192 100644
--- a/basic/source/runtime/dllmgr-x86.cxx
+++ b/basic/source/runtime/dllmgr-x86.cxx
@@ -162,7 +162,7 @@ std::size_t alignment(SbxVariable * variable) {
case SbxOBJECT:
{
std::size_t n = 1;
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
n = std::max(n, alignment(props->Get(i)));
@@ -177,7 +177,7 @@ std::size_t alignment(SbxVariable * variable) {
return 1;
}
} else {
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
for (int i = 0; i < dims; ++i) {
@@ -214,7 +214,7 @@ SbError marshalStruct(
MarshalData & data)
{
OSL_ASSERT(variable != 0);
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
SbError e = marshal(false, props->Get(i), false, blob, offset, data);
@@ -230,7 +230,7 @@ SbError marshalArray(
MarshalData & data)
{
OSL_ASSERT(variable != 0);
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
@@ -406,7 +406,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
align(
reinterpret_cast< sal_uIntPtr >(data),
alignment(variable)));
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
data = unmarshal(props->Get(i), data);
@@ -424,7 +424,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
break;
}
} else {
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 598b83c33dea..ae5b76965374 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2523,7 +2523,7 @@ RTLFUNC(IsObject)
SbUnoClass* pUnoClass;
bool bObject;
- if( pObj && NULL != ( pUnoClass=PTR_CAST(SbUnoClass,pObj) ) )
+ if( pObj && NULL != ( pUnoClass=dynamic_cast<SbUnoClass*>( pObj) ) )
{
bObject = pUnoClass->getUnoClass().is();
}
@@ -2612,12 +2612,12 @@ RTLFUNC(IsError)
else
{
SbxVariable* pVar =rPar.Get( 1 );
- SbUnoObject* pObj = PTR_CAST(SbUnoObject,pVar );
+ SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar );
if ( !pObj )
{
if ( SbxBase* pBaseObj = pVar->GetObject() )
{
- pObj = PTR_CAST(SbUnoObject, pBaseObj );
+ pObj = dynamic_cast<SbUnoObject*>( pBaseObj );
}
}
uno::Reference< script::XErrorQuery > xError;
@@ -3838,12 +3838,12 @@ OUString getObjectTypeName( SbxVariable* pVar )
}
else
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pVar );
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pVar );
if ( !pUnoObj )
{
if ( SbxBase* pBaseObj = pVar->GetObject() )
{
- pUnoObj = PTR_CAST(SbUnoObject, pBaseObj );
+ pUnoObj = dynamic_cast<SbUnoObject*>( pBaseObj );
}
}
if ( pUnoObj )
@@ -4160,7 +4160,7 @@ RTLFUNC(LBound)
return;
}
SbxBase* pParObj = rPar.Get(1)->GetObject();
- SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pArr = dynamic_cast<SbxDimArray*>( pParObj );
if( pArr )
{
sal_Int32 nLower, nUpper;
@@ -4187,7 +4187,7 @@ RTLFUNC(UBound)
}
SbxBase* pParObj = rPar.Get(1)->GetObject();
- SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pArr = dynamic_cast<SbxDimArray*>( pParObj );
if( pArr )
{
sal_Int32 nLower, nUpper;
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 9288ad77d55d..1203003b1f95 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -124,11 +124,11 @@ RTLFUNC(CallByName)
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) )
+ pObj = dynamic_cast<SbxObject*>( pObjVar );
+ if( !pObj && pObjVar && 0 != dynamic_cast<const SbxVariable*>( pObjVar) )
{
SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast<SbxObject*>( pObjVarObj );
}
if( !pObj )
{
@@ -192,7 +192,7 @@ RTLFUNC(CallByName)
break;
case vbMethod:
{
- SbMethod* pMeth = PTR_CAST(SbMethod,pFindVar);
+ SbMethod* pMeth = dynamic_cast<SbMethod*>( pFindVar );
if( pMeth == NULL )
{
StarBASIC::Error( ERRCODE_BASIC_PROC_UNDEFINED );
@@ -934,7 +934,7 @@ RTLFUNC(FindObject)
SbxObject* pFindObj = NULL;
if( pFind )
{
- pFindObj = PTR_CAST(SbxObject,pFind);
+ pFindObj = dynamic_cast<SbxObject*>( pFind );
}
SbxVariableRef refVar = rPar.Get(0);
refVar->PutObject( pFindObj );
@@ -958,12 +958,12 @@ RTLFUNC(FindPropertyObject)
SbxObject* pObj = NULL;
if( pObjVar )
{
- pObj = PTR_CAST(SbxObject,pObjVar);
+ pObj = dynamic_cast<SbxObject*>( pObjVar );
}
- if( !pObj && pObjVar && pObjVar->ISA(SbxVariable) )
+ if( !pObj && pObjVar && 0 != dynamic_cast<const SbxVariable*>( pObjVar) )
{
SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast<SbxObject*>( pObjVarObj );
}
OUString aNameStr = rPar.Get(2)->GetOUString();
@@ -972,7 +972,7 @@ RTLFUNC(FindPropertyObject)
if( pObj )
{
SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_OBJECT );
- pFindObj = PTR_CAST(SbxObject,pFindVar);
+ pFindObj = dynamic_cast<SbxObject*>( pFindVar );
}
else
{
@@ -1274,7 +1274,7 @@ void PutGet( SbxArray& rPar, bool bPut )
if( pVar->GetType() & SbxARRAY )
{
SbxBase* pParObj = pVar->GetObject();
- pArr = PTR_CAST(SbxDimArray,pParObj);
+ pArr = dynamic_cast<SbxDimArray*>( pParObj );
}
bool bRet;
@@ -1713,7 +1713,7 @@ RTLFUNC(Join)
return;
}
SbxBase* pParObj = rPar.Get(1)->GetObject();
- SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pArr = dynamic_cast<SbxDimArray*>( pParObj );
if( pArr )
{
if( pArr->GetDims() != 1 )
@@ -3288,11 +3288,11 @@ RTLFUNC(Me)
(void)bWrite;
SbModule* pActiveModule = GetSbData()->pInst->GetActiveModule();
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast<SbClassModuleObject*>( pActiveModule );
SbxVariableRef refVar = rPar.Get(0);
if( pClassModuleObject == NULL )
{
- SbObjModule* pMod = PTR_CAST(SbObjModule,pActiveModule);
+ SbObjModule* pMod = dynamic_cast<SbObjModule*>( pActiveModule );
if ( pMod )
refVar->PutObject( pMod );
else
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index d09b183fe990..fe29acdbd7b6 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -528,7 +528,7 @@ StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic )
if( pActiveModule )
{
SbxObject* pParent = pActiveModule->GetParent();
- if( pParent && pParent->ISA(StarBASIC) )
+ if( pParent && 0 != dynamic_cast<const StarBASIC*>( pParent) )
{
pCurBasic = static_cast<StarBASIC*>(pParent);
}
@@ -1169,7 +1169,7 @@ void SbiRuntime::PushForEach()
BasicCollection* pCollection;
SbxDimArray* pArray;
SbUnoObject* pUnoObj;
- if( (pArray = PTR_CAST(SbxDimArray,pObj)) != NULL )
+ if( (pArray = dynamic_cast<SbxDimArray*>( pObj)) != NULL )
{
p->eForType = FOR_EACH_ARRAY;
p->refEnd = reinterpret_cast<SbxVariable*>(pArray);
@@ -1186,13 +1186,13 @@ void SbiRuntime::PushForEach()
p->pArrayUpperBounds[i] = uBound;
}
}
- else if( (pCollection = PTR_CAST(BasicCollection,pObj)) != NULL )
+ else if( (pCollection = dynamic_cast<BasicCollection*>( pObj)) != NULL )
{
p->eForType = FOR_EACH_COLLECTION;
p->refEnd = pCollection;
p->nCurCollectionIndex = 0;
}
- else if( (pUnoObj = PTR_CAST(SbUnoObject,pObj)) != NULL )
+ else if( (pUnoObj = dynamic_cast<SbUnoObject*>( pObj)) != NULL )
{
// XEnumerationAccess?
Any aAny = pUnoObj->getUnoAny();
@@ -1268,7 +1268,7 @@ SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection* p
{
SbxVariable* pVar = p->refEnd.Is() ? p->refEnd.get() : NULL;
if( p->eForType == FOR_EACH_COLLECTION && pVar != NULL &&
- PTR_CAST(BasicCollection,pVar) == pCollection )
+ dynamic_cast<BasicCollection*>( pVar) == pCollection )
{
return p;
}
@@ -1640,15 +1640,15 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
return false;
}
// #115826: Exclude ProcedureProperties to avoid call to Property Get procedure
- else if( refVar->ISA(SbProcedureProperty) )
+ else if( 0 != dynamic_cast<const SbProcedureProperty*>( &refVar) )
return false;
SbxObjectRef xValObj = static_cast<SbxObject*>(refVal->GetObject());
- if( !xValObj.Is() || xValObj->ISA(SbUnoAnyObject) )
+ if( !xValObj.Is() || 0 != dynamic_cast<const SbUnoAnyObject*>( &xValObj) )
return false;
- SbUnoObject* pUnoVal = PTR_CAST(SbUnoObject,static_cast<SbxObject*>(xValObj));
- SbUnoStructRefObject* pUnoStructVal = PTR_CAST(SbUnoStructRefObject,static_cast<SbxObject*>(xValObj));
+ SbUnoObject* pUnoVal = dynamic_cast<SbUnoObject*>( static_cast<SbxObject*>(xValObj.get()) );
+ SbUnoStructRefObject* pUnoStructVal = dynamic_cast<SbUnoStructRefObject*>( static_cast<SbxObject*>(xValObj) );
Any aAny;
// make doubly sure value is either an Uno object or
// an uno struct
@@ -1670,7 +1670,7 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
else
SbxBase::ResetError();
- SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,static_cast<SbxObject*>(xVarObj));
+ SbUnoStructRefObject* pUnoStructObj = dynamic_cast<SbUnoStructRefObject*>( static_cast<SbxObject*>(xVarObj.get()) );
OUString sClassName = pUnoVal ? pUnoVal->GetClassName() : pUnoStructVal->GetClassName();
OUString sName = pUnoVal ? pUnoVal->GetName() : pUnoStructVal->GetName();
@@ -1830,7 +1830,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
SbxBase* pObjVarObj = refVal->GetObject();
if( pObjVarObj )
{
- SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
+ SbxVariableRef refObjVal = dynamic_cast<SbxObject*>( pObjVarObj );
if( refObjVal )
{
@@ -1860,7 +1860,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
n = refVar->GetFlags();
refVar->SetFlag( SbxFlagBits::Write );
}
- SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty, refVar.get());
+ SbProcedureProperty* pProcProperty = dynamic_cast<SbProcedureProperty*>( refVar.get() );
if( pProcProperty )
{
pProcProperty->setSet( true );
@@ -1896,14 +1896,14 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
SbxObject* pObj = NULL;
- pObj = PTR_CAST(SbxObject,refVar.get());
+ pObj = dynamic_cast<SbxObject*>( refVar.get() );
// calling GetObject on a SbxEMPTY variable raises
// object not set errors, make sure its an Object
if ( !pObj && refVar->GetType() == SbxOBJECT )
{
SbxBase* pObjVarObj = refVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast<SbxObject*>( pObjVarObj );
}
SbxVariable* pDflt = NULL;
if ( pObj && !bObjAssign )
@@ -1932,7 +1932,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
Reference< XInterface > xComListener;
SbxBase* pObj = refVal->GetObject();
- SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
+ SbUnoObject* pUnoObj = (pObj != NULL) ? dynamic_cast<SbUnoObject*>( pObj ) : NULL;
if( pUnoObj != NULL )
{
Any aControlAny = pUnoObj->getUnoAny();
@@ -1959,7 +1959,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
}
if ( bDimAsNew )
{
- if( !refVar->ISA(SbxObject) )
+ if( 0 == dynamic_cast<const SbxObject*>( &refVar) )
{
SbxBase* pValObjBase = refVal->GetObject();
if( pValObjBase == NULL )
@@ -1996,12 +1996,12 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
if( bFirstInit )
{
// Store information to instantiate object later
- SbxObject* pValObj = PTR_CAST(SbxObject,pValObjBase);
+ SbxObject* pValObj = dynamic_cast<SbxObject*>( pValObjBase );
if( pValObj != NULL )
{
OUString aObjClass = pValObj->GetClassName();
- SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pValObjBase);
+ SbClassModuleObject* pClassModuleObj = dynamic_cast<SbClassModuleObject*>( pValObjBase );
DimAsNewRecoverHash &rDimAsNewRecoverHash = GaDimAsNewRecoverHash::get();
if( pClassModuleObj != NULL )
{
@@ -2247,7 +2247,7 @@ void SbiRuntime::StepREDIMP()
if( refRedimpArray.Is() )
{
SbxBase* pElemObj = refVar->GetObject();
- SbxDimArray* pNewArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pNewArray = dynamic_cast<SbxDimArray*>( pElemObj );
SbxDimArray* pOldArray = static_cast<SbxDimArray*>(static_cast<SbxArray*>(refRedimpArray));
if( pNewArray )
{
@@ -2304,7 +2304,7 @@ void SbiRuntime::StepREDIMP_ERASE()
if( eType & SbxARRAY )
{
SbxBase* pElemObj = refVar->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast<SbxDimArray*>( pElemObj );
if( pDimArray )
{
refRedimpArray = pDimArray;
@@ -2338,7 +2338,7 @@ static void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
if ( bVBAEnabled )
{
SbxBase* pElemObj = refVar->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast<SbxDimArray*>( pElemObj );
bool bClearValues = true;
if( pDimArray )
{
@@ -2355,7 +2355,7 @@ static void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
}
if ( bClearValues )
{
- SbxArray* pArray = PTR_CAST(SbxArray,pElemObj);
+ SbxArray* pArray = dynamic_cast<SbxArray*>( pElemObj );
if ( pArray )
{
pArray->Clear();
@@ -2444,7 +2444,9 @@ void SbiRuntime::StepARGV()
SbxVariableRef pVal = PopVar();
// Before fix of #94916:
- if( pVal->ISA(SbxMethod) || pVal->ISA(SbUnoProperty) || pVal->ISA(SbProcedureProperty) )
+ if( 0 != dynamic_cast<const SbxMethod*>( &pVal)
+ || 0 != dynamic_cast<const SbUnoProperty*>( &pVal)
+ || 0 != dynamic_cast<const SbProcedureProperty*>( &pVal) )
{
// evaluate methods and properties!
SbxVariable* pRes = new SbxVariable( *pVal );
@@ -2851,7 +2853,7 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
{
OUString aAlias( pImg->GetString( static_cast<short>( nOp1 ) ) );
SbxVariableRef pVal = PopVar();
- if( bVBAEnabled && ( pVal->ISA(SbxMethod) || pVal->ISA(SbUnoProperty) || pVal->ISA(SbProcedureProperty) ) )
+ if( bVBAEnabled && ( 0 != dynamic_cast<const SbxMethod*>( &pVal) || 0 != dynamic_cast<const SbUnoProperty*>( &pVal) || 0 != dynamic_cast<const SbProcedureProperty*>( &pVal) ) )
{
// named variables ( that are Any especially properties ) can be empty at this point and need a broadcast
if ( pVal->GetType() == SbxEMPTY )
@@ -3230,7 +3232,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
SbxDataType t = refVal->GetType();
SbxVariable* pVal = refVal.get();
// we don't know the type of uno properties that are (maybevoid)
- if ( t == SbxEMPTY && refVal->ISA(SbUnoProperty) )
+ if ( t == SbxEMPTY && 0 != dynamic_cast<const SbUnoProperty*>( &refVal) )
{
SbUnoProperty* pProp = static_cast<SbUnoProperty*>(pVal);
t = pProp->getRealType();
@@ -3252,7 +3254,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
{
if ( ( bVBAEnabled || CodeCompleteOptions::IsExtendedTypeDeclaration() ) && pObj->IsA( TYPE(SbUnoObject) ) )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
bOk = checkUnoObjectType( pUnoObj, aClass );
}
else
@@ -3267,7 +3269,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
{
bOk = true;
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pObj);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast<SbClassModuleObject*>( pObj );
if( pClassModuleObject != NULL )
pClassModuleObject->triggerInitializeEvent();
}
@@ -3581,7 +3583,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt
// definitely we want this for VBA where properties are often
// collections ( which need index access ), but lets only do
// this if we actually have params following
- else if( bVBAEnabled && pElem->ISA(SbUnoProperty) && pElem->GetParameters() )
+ else if( bVBAEnabled && 0 != dynamic_cast<const SbUnoProperty*>( pElem) && pElem->GetParameters() )
{
SbxVariableRef refTemp = pElem;
@@ -3686,11 +3688,11 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
{
bool bError_ = true;
- SbUnoMethod* pUnoMethod = PTR_CAST(SbUnoMethod,p);
- SbUnoProperty* pUnoProperty = PTR_CAST(SbUnoProperty,p);
+ SbUnoMethod* pUnoMethod = dynamic_cast<SbUnoMethod*>( p );
+ SbUnoProperty* pUnoProperty = dynamic_cast<SbUnoProperty*>( p );
if( pUnoMethod || pUnoProperty )
{
- SbUnoObject* pParentUnoObj = PTR_CAST( SbUnoObject,p->GetParent() );
+ SbUnoObject* pParentUnoObj = dynamic_cast<SbUnoObject*>( p->GetParent() );
if( pParentUnoObj )
{
Any aUnoAny = pParentUnoObj->getUnoAny();
@@ -3718,11 +3720,11 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
}
}
}
- else if( bVBAEnabled && p->GetType() == SbxOBJECT && (!p->ISA(SbxMethod) || !p->IsBroadcaster()) )
+ else if( bVBAEnabled && p->GetType() == SbxOBJECT && (0 == dynamic_cast<const SbxMethod*>( p) || !p->IsBroadcaster()) )
{
// Check for default method with named parameters
SbxBaseRef pObj = p->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj) )
{
SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj));
Any aAny = pUnoObj->getUnoAny();
@@ -3808,7 +3810,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
if( ( pElem->GetType() & SbxARRAY ) && refRedim.get() != pElem )
{
SbxBase* pElemObj = pElem->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast<SbxDimArray*>( pElemObj );
pPar = pElem->GetParameters();
if( pDimArray )
{
@@ -3819,7 +3821,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
else
{
- SbxArray* pArray = PTR_CAST(SbxArray,pElemObj);
+ SbxArray* pArray = dynamic_cast<SbxArray*>( pElemObj );
if( pArray )
{
if( !pPar )
@@ -3841,7 +3843,9 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
}
// consider index-access for UnoObjects
- else if( pElem->GetType() == SbxOBJECT && !pElem->ISA(SbxMethod) && ( !bVBAEnabled || !pElem->ISA(SbxProperty) ) )
+ else if( pElem->GetType() == SbxOBJECT &&
+ 0 == dynamic_cast<const SbxMethod*>( pElem) &&
+ ( !bVBAEnabled || 0 == dynamic_cast<const SbxProperty*>( pElem) ) )
{
pPar = pElem->GetParameters();
if ( pPar )
@@ -3850,7 +3854,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
SbxBaseRef pObj = pElem->GetObject();
if( pObj )
{
- if( pObj->ISA(SbUnoObject) )
+ if( 0 != dynamic_cast<const SbUnoObject*>( &pObj) )
{
SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj));
Any aAny = pUnoObj->getUnoAny();
@@ -3921,7 +3925,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
SbxBaseRef pDfltObj = pDflt->GetObject();
if( pDfltObj )
{
- if( pDfltObj->ISA(SbUnoObject) )
+ if( 0 != dynamic_cast<const SbUnoObject*>( &pDfltObj) )
{
pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pDfltObj));
Any aUnoAny = pUnoObj->getUnoAny();
@@ -3961,7 +3965,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
// #42940, set parameter 0 to NULL so that var doesn't contain itself
pPar->Put( NULL, 0 );
}
- else if( pObj->ISA(BasicCollection) )
+ else if( 0 != dynamic_cast<const BasicCollection*>( &pObj) )
{
BasicCollection* pCol = static_cast<BasicCollection*>(static_cast<SbxBase*>(pObj));
pElem = new SbxVariable( SbxVARIANT );
@@ -4010,7 +4014,7 @@ void SbiRuntime::StepFIND( sal_uInt32 nOp1, sal_uInt32 nOp2 )
void SbiRuntime::StepFIND_CM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pMod);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast<SbClassModuleObject*>( pMod );
if( pClassModuleObject )
{
pMod->SetFlag( SbxFlagBits::GlobalSearch );
@@ -4035,11 +4039,11 @@ void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
SbxVariableRef pObjVar = PopVar();
- SbxObject* pObj = PTR_CAST(SbxObject, pObjVar.get());
+ SbxObject* pObj = dynamic_cast<SbxObject*>( pObjVar.get() );
if( !pObj )
{
SbxBase* pObjVarObj = pObjVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast<SbxObject*>( pObjVarObj );
}
// #56368 save reference at StepElem, otherwise objects could
@@ -4380,7 +4384,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
SbxDimArray* pArray = 0;
- if( xObj->ISA(SbxDimArray) )
+ if( 0 != dynamic_cast<const SbxDimArray*>( &xObj) )
{
SbxBase* pObj = static_cast<SbxBase*>(xObj);
pArray = static_cast<SbxDimArray*>(pObj);
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx
index 674eae2d9541..8d896939c8f8 100644
--- a/basic/source/sbx/sbxbool.cxx
+++ b/basic/source/sbx/sbxbool.cxx
@@ -95,7 +95,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetBool() ? SbxTRUE : SbxFALSE;
else
@@ -181,7 +181,7 @@ void ImpPutBool( SbxValues* p, sal_Int16 n )
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutBool( n != 0 );
else
diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 160f23fea21c..0879b8e8caa8 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -174,7 +174,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetByte();
else
@@ -264,7 +264,7 @@ void ImpPutByte( SbxValues* p, sal_uInt8 n )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutByte( n );
else
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index 9070b8bdd514..5795f43b75a7 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -160,7 +160,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetChar();
else
@@ -255,7 +255,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutChar( n );
else
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 6513d29aad2b..f02df28b2708 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -172,7 +172,7 @@ void SbxCollection::CollAdd( SbxArray* pPar_ )
else
{
SbxBase* pObj = pPar_->Get( 1 )->GetObject();
- if( !pObj || !( pObj->ISA(SbxObject) ) )
+ if( !pObj || !( 0 != dynamic_cast<const SbxObject*>( pObj) ) )
{
SetError( ERRCODE_SBX_NOTIMP );
}
@@ -273,7 +273,7 @@ SbxStdCollection::~SbxStdCollection()
void SbxStdCollection::Insert( SbxVariable* p )
{
- SbxObject* pObj = PTR_CAST(SbxObject,p);
+ SbxObject* pObj = dynamic_cast<SbxObject*>( p );
if( pObj && !pObj->IsClass( aElemClass ) )
SetError( ERRCODE_SBX_BAD_ACTION );
else
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 49f324eed9be..b76f8ba4386d 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -326,7 +326,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetCurrency();
else
@@ -436,7 +436,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutCurrency( r );
else
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index d3ab7718bf8b..ebe574d42292 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -148,7 +148,7 @@ double ImpGetDate( const SbxValues* p )
}
break;
case SbxOBJECT:
- pVal = PTR_CAST(SbxValue,p->pObj);
+ pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
{
nRes = pVal->GetDate();
@@ -316,7 +316,7 @@ start:
break;
}
case SbxOBJECT:
- pVal = PTR_CAST(SbxValue,p->pObj);
+ pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
{
pVal->PutDate( n );
diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx
index 51c391c5d4e2..16281f7a6eb5 100644
--- a/basic/source/sbx/sbxdbl.cxx
+++ b/basic/source/sbx/sbxdbl.cxx
@@ -94,7 +94,7 @@ double ImpGetDouble( const SbxValues* p )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetDouble();
else
@@ -201,7 +201,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutDouble( n );
else
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index df561c715319..452832d3ddd8 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -478,7 +478,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pnDecRes->setDecimal( pVal->GetDecimal() );
else
@@ -597,7 +597,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutDecimal( pDec );
else
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index ab9a0f029b94..9c64095768f4 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -92,10 +92,10 @@ 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,static_cast<SbxVariable*>(refVar));
+ pObj = dynamic_cast<SbxObject*>( static_cast<SbxVariable*>(refVar) );
if( !pObj )
// Then it had to deliver an object
- pObj = PTR_CAST(SbxObject,refVar->GetObject());
+ pObj = dynamic_cast<SbxObject*>( refVar->GetObject() );
refVar.Clear();
if( !pObj )
break;
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index 910b3e618824..142e36534811 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -172,7 +172,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetInteger();
else
@@ -269,7 +269,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutInteger( n );
else
@@ -450,7 +450,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetInt64();
else
@@ -550,7 +550,7 @@ start:
}
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutInt64( n );
else
@@ -727,7 +727,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetUInt64();
else
@@ -828,7 +828,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutUInt64( n );
else
diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx
index e9a9ee96b5fd..d176c2111dae 100644
--- a/basic/source/sbx/sbxlng.cxx
+++ b/basic/source/sbx/sbxlng.cxx
@@ -131,7 +131,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetLong();
else
@@ -230,7 +230,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutLong( n );
else
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index c38737dea8ef..4b1499944ffa 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -292,7 +292,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
bool SbxObject::Call( const OUString& rName, SbxArray* pParam )
{
SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE);
- if( pMeth && pMeth->ISA(SbxMethod) )
+ if( pMeth && 0 != dynamic_cast<const SbxMethod*>( pMeth) )
{
// FindQualified() might have struck already!
if( pParam )
@@ -385,7 +385,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp
return NULL;
}
// Collections may contain objects of the same name
- if( !( ct == SbxCLASS_OBJECT && ISA(SbxCollection) ) )
+ if( !( ct == SbxCLASS_OBJECT && 0 != dynamic_cast<const SbxCollection*>( this ) ) )
{
SbxVariable* pRes = pArray->Find( rName, ct );
if( pRes )
@@ -429,7 +429,7 @@ void SbxObject::Insert( SbxVariable* pVar )
{
// Then this element exists already
// There are objects of the same name allowed at collections
- if( pArray == pObjs && ISA(SbxCollection) )
+ if( pArray == pObjs && 0 != dynamic_cast<const SbxCollection*>( this ) )
{
nIdx = pArray->Count();
}
@@ -463,9 +463,9 @@ void SbxObject::Insert( SbxVariable* pVar )
static const char* pCls[] =
{ "DontCare","Array","Value","Variable","Method","Property","Object" };
OUString aVarName( pVar->GetName() );
- if ( aVarName.isEmpty() && pVar->ISA(SbxObject) )
+ if ( aVarName.isEmpty() && 0 != dynamic_cast<const SbxObject*>( pVar) )
{
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ aVarName = dynamic_cast<SbxObject*>( pVar)->GetClassName( );
}
SAL_INFO(
"basic.sbx",
@@ -507,9 +507,9 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
static const char* pCls[] =
{ "DontCare","Array","Value","Variable","Method","Property","Object" };
OUString aVarName( pVar->GetName() );
- if ( aVarName.isEmpty() && pVar->ISA(SbxObject) )
+ if ( aVarName.isEmpty() && 0 != dynamic_cast<const SbxObject*>( pVar) )
{
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ aVarName = dynamic_cast<SbxObject*>( pVar)->GetClassName( );
}
SAL_INFO(
"basic.sbx",
@@ -535,9 +535,9 @@ void SbxObject::Remove( SbxVariable* pVar )
{
#ifdef DBG_UTIL
OUString aVarName( pVar->GetName() );
- if ( aVarName.isEmpty() && pVar->ISA(SbxObject) )
+ if ( aVarName.isEmpty() && 0 != dynamic_cast<const SbxObject*>( pVar) )
{
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ aVarName = dynamic_cast<SbxObject*>( pVar)->GetClassName( );
}
SAL_INFO(
"basic.sbx",
@@ -855,11 +855,11 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
if ( pVar )
{
rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( " - Sub" );
- if ( pVar->ISA(SbxObject) )
+ if ( 0 != dynamic_cast<const SbxObject*>( pVar) )
{
static_cast<SbxObject*>(pVar)->Dump( rStrm, bFill );
}
- else if ( pVar->ISA(SbxVariable) )
+ else if ( 0 != dynamic_cast<const SbxVariable*>( pVar) )
{
static_cast<SbxVariable*>(pVar)->Dump( rStrm, bFill );
}
diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx
index fb7e228f440a..bb8b91d8776c 100644
--- a/basic/source/sbx/sbxsng.cxx
+++ b/basic/source/sbx/sbxsng.cxx
@@ -123,7 +123,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetSingle();
else
@@ -223,7 +223,7 @@ start:
}
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutSingle( n );
else
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index 0db3d0493758..025e3551b79a 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -78,7 +78,7 @@ OUString ImpGetString( const SbxValues* p )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
{
aRes = pVal->GetOUString();
@@ -87,7 +87,7 @@ OUString ImpGetString( const SbxValues* p )
&& (p->pObj->GetType() == (SbxARRAY | SbxBYTE )) )
{
// convert byte array to string
- SbxArray* pArr = PTR_CAST(SbxArray, p->pObj);
+ SbxArray* pArr = dynamic_cast<SbxArray*>( p->pObj );
if( pArr )
{
aRes = ByteArrayToString( pArr );
@@ -214,7 +214,7 @@ void ImpPutString( SbxValues* p, const OUString* n )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutString( *n );
else
diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx
index 06784c309424..8c550e5cc965 100644
--- a/basic/source/sbx/sbxuint.cxx
+++ b/basic/source/sbx/sbxuint.cxx
@@ -166,7 +166,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetUShort();
else
@@ -263,7 +263,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutUShort( n );
else
diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx
index 892d5f3e6603..461884704f07 100644
--- a/basic/source/sbx/sbxulng.cxx
+++ b/basic/source/sbx/sbxulng.cxx
@@ -133,7 +133,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
nRes = pVal->GetULong();
else
@@ -228,7 +228,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->pObj );
if( pVal )
pVal->PutULong( n );
else
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 2103856169b3..a8d136143a8d 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -143,7 +143,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
&& (aData.eType == SbxSTRING) )
{
SbxBase* pObj = r.GetObject();
- SbxArray* pArr = PTR_CAST(SbxArray, pObj);
+ SbxArray* pArr = dynamic_cast<SbxArray*>( pObj );
if( pArr )
{
OUString aStr = ByteArrayToString( pArr );
@@ -193,7 +193,7 @@ void SbxValue::Clear()
if( aData.pObj != this )
{
SAL_INFO("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef");
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this );
bool bParentProp = pThisVar && 5345 ==
static_cast<sal_uInt16>(pThisVar->GetUserData());
if ( !bParentProp )
@@ -244,7 +244,7 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const
if( t == SbxOBJECT )
{
// The block contains an object or a variable
- SbxObject* pObj = PTR_CAST(SbxObject,p->aData.pObj);
+ SbxObject* pObj = dynamic_cast<SbxObject*>( p->aData.pObj );
if( pObj )
{
// Has the object a default property?
@@ -276,18 +276,18 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const
break;
}
// Did we have an array?
- SbxArray* pArray = PTR_CAST(SbxArray,p->aData.pObj);
+ SbxArray* pArray = dynamic_cast<SbxArray*>( p->aData.pObj );
if( pArray )
{
// When indicated get the parameter
SbxArray* pPar = NULL;
- SbxVariable* pVar = PTR_CAST(SbxVariable,p);
+ SbxVariable* pVar = dynamic_cast<SbxVariable*>( p );
if( pVar )
pPar = pVar->GetParameters();
if( pPar )
{
// Did we have a dimensioned array?
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,p->aData.pObj);
+ SbxDimArray* pDimArray = dynamic_cast<SbxDimArray*>( p->aData.pObj );
if( pDimArray )
p = pDimArray->Get( pPar );
else
@@ -296,7 +296,7 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const
}
}
// Otherwise guess a SbxValue
- SbxValue* pVal = PTR_CAST(SbxValue,p->aData.pObj);
+ SbxValue* pVal = dynamic_cast<SbxValue*>( p->aData.pObj );
if( pVal )
p = pVal;
else
@@ -539,7 +539,7 @@ bool SbxValue::Put( const SbxValues& rVal )
OSL_FAIL( "TheRealValue" );
}
SAL_INFO("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef");
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this );
bool bParentProp = pThisVar && 5345 ==
static_cast<sal_uInt16>(pThisVar->GetUserData());
if ( !bParentProp )
@@ -733,7 +733,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const
return false;
}
// Test downcast!!!
- if( this->ISA(SbxVariable) )
+ if( 0 != dynamic_cast<const SbxVariable*>( this) )
const_cast<SbxVariable*>(static_cast<const SbxVariable*>(this))->Broadcast( SBX_HINT_DATAWANTED );
SbxDataType t = GetType();
if( t == SbxSTRING )
@@ -802,7 +802,7 @@ bool SbxValue::SetType( SbxDataType t )
if( aData.pObj && aData.pObj != this )
{
SAL_WARN("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef");
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this );
sal_uInt16 nSlotId = pThisVar
? static_cast<sal_uInt16>(pThisVar->GetUserData())
: 0;
@@ -1604,7 +1604,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
// to save itself as Objectptr does not work!
if( aData.pObj )
{
- if( PTR_CAST(SbxValue,aData.pObj) != this )
+ if( dynamic_cast<SbxValue*>( aData.pObj) != this )
{
r.WriteUChar( 1 );
return aData.pObj->Store( r );
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 671c42c0793d..83538ac6c02f 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -408,7 +408,7 @@ void SbxVariable::SetParent( SbxObject* p )
{
#ifdef DBG_UTIL
// Will the parent of a SbxObject be set?
- if ( p && ISA(SbxObject) )
+ if ( p && 0 != dynamic_cast<const SbxObject*>( ) )
{
// then this had to be a child of the new parent
bool bFound = false;