summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2015-09-30 16:10:07 +0200
committerOliver Specht <oliver.specht@cib.de>2015-10-06 07:29:37 +0000
commit89d39bc100aabf5dccbe77c0b5c0c85736e85b39 (patch)
tree871a91210913ecee91530c95392534bf18f80f3f /basic
parent32b9901dae7403453d773f5904de15551a323595 (diff)
tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in idl, editeng, sc, sd, sw, sfx2, sot, starmath Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653 Reviewed-on: https://gerrit.libreoffice.org/19132 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sb.cxx4
-rw-r--r--basic/source/classes/sbxmod.cxx4
-rw-r--r--basic/source/comp/parser.cxx2
-rw-r--r--basic/source/runtime/methods.cxx10
-rw-r--r--basic/source/runtime/runtime.cxx18
-rw-r--r--basic/source/sbx/sbxobj.cxx4
-rw-r--r--basic/source/sbx/sbxvar.cxx2
7 files changed, 22 insertions, 22 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 57080ca15a09..01586bd94996 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1106,7 +1106,7 @@ SbModule* StarBASIC::MakeModule32( const OUString& rName, const ModuleInfo& mInf
void StarBASIC::Insert( SbxVariable* pVar )
{
- if( pVar->IsA( TYPE(SbModule) ) )
+ if( dynamic_cast<const SbModule*>(pVar) != nullptr)
{
pModules->Insert( pVar, pModules->Count() );
pVar->SetParent( this );
@@ -1125,7 +1125,7 @@ void StarBASIC::Insert( SbxVariable* pVar )
void StarBASIC::Remove( SbxVariable* pVar )
{
- if( pVar->IsA( TYPE(SbModule) ) )
+ if( dynamic_cast<const SbModule*>(pVar) != nullptr)
{
// #87540 Can be last reference!
SbxVariableRef xVar = pVar;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 167a172f0c73..ce72ed39514b 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -966,14 +966,14 @@ void SbModule::SetSource32( const OUString& r )
static void _SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p )
{
// Self a BASIC?
- if( pObj->IsA( TYPE(StarBASIC) ) && pObj->IsBroadcaster() )
+ if( dynamic_cast<const StarBASIC *>(pObj) != nullptr && pObj->IsBroadcaster() )
pObj->GetBroadcaster().Broadcast( SbxHint( nId, p ) );
// Then ask for the subobjects
SbxArray* pObjs = pObj->GetObjects();
for( sal_uInt16 i = 0; i < pObjs->Count(); i++ )
{
SbxVariable* pVar = pObjs->Get( i );
- if( pVar->IsA( TYPE(SbxObject) ) )
+ if( dynamic_cast<const SbxObject *>(pVar) != nullptr )
_SendHint( dynamic_cast<SbxObject*>( pVar), nId, p );
}
}
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 97592cb9d3ba..c3e7a898fceb 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -156,7 +156,7 @@ SbiSymDef* SbiParser::CheckRTLForSym(const OUString& rSym, SbxDataType eType)
if (!pVar)
return nullptr;
- if (pVar->IsA(TYPE(SbxMethod)))
+ if (dynamic_cast<const SbxMethod *>(pVar) != nullptr)
{
SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym );
SbxMethod* pMethod = static_cast<SbxMethod*>(pVar);
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 2c21bc3e768b..4628686c0f69 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4439,11 +4439,11 @@ RTLFUNC(Load)
SbxBase* pObj = static_cast<SbxObject*>(rPar.Get(1)->GetObject());
if ( pObj )
{
- if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ if( dynamic_cast<const SbUserFormModule *>(pObj) != nullptr )
{
static_cast<SbUserFormModule*>(pObj)->Load();
}
- else if( pObj->IsA( TYPE( SbxObject ) ) )
+ else if( dynamic_cast<const SbxObject *>(pObj) != nullptr )
{
SbxVariable* pVar = static_cast<SbxObject*>(pObj)->Find( OUString("Load"), SbxCLASS_METHOD );
if( pVar )
@@ -4470,12 +4470,12 @@ RTLFUNC(Unload)
SbxBase* pObj = static_cast<SbxObject*>(rPar.Get(1)->GetObject());
if ( pObj )
{
- if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ if( dynamic_cast<const SbUserFormModule *>(pObj) != nullptr )
{
SbUserFormModule* pFormModule = static_cast<SbUserFormModule*>(pObj);
pFormModule->Unload();
}
- else if( pObj->IsA( TYPE( SbxObject ) ) )
+ else if( dynamic_cast<const SbxObject *>(pObj) != nullptr )
{
SbxVariable* pVar = static_cast<SbxObject*>(pObj)->Find( OUString("Unload"), SbxCLASS_METHOD );
if( pVar )
@@ -4524,7 +4524,7 @@ RTLFUNC(SavePicture)
}
SbxBase* pObj = static_cast<SbxObject*>(rPar.Get(1)->GetObject());
- if( pObj->IsA( TYPE( SbStdPicture ) ) )
+ if( dynamic_cast<const SbStdPicture *>(pObj) != nullptr )
{
SvFileStream aOStream( rPar.Get(2)->GetOUString(), StreamMode::WRITE | StreamMode::TRUNC );
Graphic aGraphic = static_cast<SbStdPicture*>(pObj)->GetGraphic();
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 04416668535a..33ab052aa623 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -673,7 +673,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
SbxVariable* v = pParams->Get( i );
// methods are always byval!
- bool bByVal = v->IsA( TYPE(SbxMethod) );
+ bool bByVal = dynamic_cast<const SbxMethod *>(v) != nullptr;
SbxDataType t = v->GetType();
bool bTargetTypeIsArray = false;
if( p )
@@ -995,7 +995,7 @@ SbxVariableRef SbiRuntime::PopVar()
SAL_INFO("basic", "PopVar: Name equals 'Cells'" );
#endif
// methods hold themselves in parameter 0
- if( xVar->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast<const SbxMethod *>(xVar.get()) != nullptr )
{
xVar->SetParameters(0);
}
@@ -1725,7 +1725,7 @@ void SbiRuntime::StepPUT()
refVar->Broadcast( SBX_HINT_DATAWANTED );
if ( refVar->GetType() == SbxOBJECT )
{
- if ( refVar->IsA( TYPE(SbxMethod) ) || ! refVar->GetParent() )
+ if ( dynamic_cast<const SbxMethod *>(refVar.get()) != nullptr || ! refVar->GetParent() )
{
SbxVariable* pDflt = getDefaultProp( refVar );
@@ -1735,7 +1735,7 @@ void SbiRuntime::StepPUT()
else
bObjAssign = true;
}
- if ( refVal->GetType() == SbxOBJECT && !bObjAssign && ( refVal->IsA( TYPE(SbxMethod) ) || ! refVal->GetParent() ) )
+ if ( refVal->GetType() == SbxOBJECT && !bObjAssign && ( dynamic_cast<const SbxMethod *>(refVal.get()) != nullptr || ! refVal->GetParent() ) )
{
SbxVariable* pDflt = getDefaultProp( refVal );
if ( pDflt )
@@ -1877,7 +1877,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
bool bObjAssign = false;
if ( refVar->GetType() == SbxOBJECT )
{
- if ( refVar->IsA( TYPE(SbxMethod) ) || ! refVar->GetParent() )
+ if ( dynamic_cast<const SbxMethod *>(refVar.get()) != nullptr || ! refVar->GetParent() )
{
SbxVariable* pDflt = getDefaultProp( refVar );
if ( pDflt )
@@ -3240,19 +3240,19 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
if( t == SbxOBJECT )
{
SbxObject* pObj;
- if( pVal->IsA( TYPE(SbxObject) ) )
+ if( dynamic_cast<const SbxObject *>(pVal) != nullptr )
pObj = static_cast<SbxObject*>( pVal );
else
{
pObj = static_cast<SbxObject*>( refVal->GetObject() );
- if( pObj && !pObj->IsA( TYPE(SbxObject) ) )
+ if( pObj && dynamic_cast<const SbxObject *>(pObj) == nullptr )
pObj = NULL;
}
if( pObj )
{
if( !implIsClass( pObj, aClass ) )
{
- if ( ( bVBAEnabled || CodeCompleteOptions::IsExtendedTypeDeclaration() ) && pObj->IsA( TYPE(SbUnoObject) ) )
+ if ( ( bVBAEnabled || CodeCompleteOptions::IsExtendedTypeDeclaration() ) && dynamic_cast<const SbUnoObject *>(pObj) != nullptr )
{
SbUnoObject& rUnoObj = dynamic_cast<SbUnoObject&>(*pObj);
bOk = checkUnoObjectType(rUnoObj, aClass);
@@ -3540,7 +3540,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt
SetupArgs( pElem, nOp1 );
}
// because a particular call-type is requested
- if( pElem->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast<const SbxMethod *>(pElem) != nullptr )
{
// shall the type be converted?
SbxDataType t2 = pElem->GetType();
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 4b1499944ffa..46f34f13d2e6 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -783,7 +783,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
{
aLine += aAttrs2;
}
- if( !pVar->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast<const SbxMethod *>(pVar) == nullptr )
{
aLine += " !! Not a Method !!";
}
@@ -822,7 +822,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
{
aLine += aAttrs3;
}
- if( !pVar->IsA( TYPE(SbxProperty) ) )
+ if( dynamic_cast<const SbxProperty *>(pVar) == nullptr )
{
aLine += " !! Not a Property !!";
}
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 2e353261b5c7..bb8880c690eb 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -590,7 +590,7 @@ bool SbxVariable::StoreData( SvStream& rStrm ) const
{
rStrm.WriteUChar( 0xFF ); // Marker
bool bValStore;
- if( this->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast<const SbxMethod *>(this) != nullptr )
{
// #50200 Avoid that objects , which during the runtime
// as return-value are saved in the method as a value were saved