summaryrefslogtreecommitdiff
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
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>
-rw-r--r--avmedia/source/framework/mediatoolbox.cxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx4
-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
-rw-r--r--cui/source/customize/acccfg.cxx6
-rw-r--r--cui/source/dialogs/hldocntp.cxx2
-rw-r--r--cui/source/dialogs/zoom.cxx2
-rw-r--r--cui/source/options/cfgchart.cxx2
-rw-r--r--cui/source/options/connpoolsettings.cxx2
-rw-r--r--cui/source/options/dbregistersettings.cxx2
-rw-r--r--cui/source/options/optgdlg.cxx3
-rw-r--r--cui/source/tabpages/numfmt.cxx2
-rw-r--r--cui/source/tabpages/tplneend.cxx8
-rw-r--r--dbaccess/source/filter/xml/xmlColumn.cxx7
-rw-r--r--dbaccess/source/filter/xml/xmlStyleImport.cxx6
-rw-r--r--dbaccess/source/filter/xml/xmlTable.cxx2
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx2
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx12
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx6
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx4
-rw-r--r--dbaccess/source/ui/dlg/dbwiz.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx2
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/optionalboolitem.cxx2
-rw-r--r--dbaccess/source/ui/misc/propertysetitem.cxx2
-rw-r--r--dbaccess/source/ui/misc/stringlistitem.cxx2
-rw-r--r--vcl/source/edit/textundo.cxx2
-rw-r--r--xmloff/source/chart/SchXMLAxisContext.cxx4
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx4
-rw-r--r--xmloff/source/chart/SchXMLLegendContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx4
-rw-r--r--xmloff/source/core/xmlimp.cxx2
-rw-r--r--xmloff/source/draw/shapeimport.cxx2
-rw-r--r--xmloff/source/draw/ximppage.cxx10
-rw-r--r--xmloff/source/draw/ximpshap.cxx10
-rw-r--r--xmloff/source/draw/ximpstyl.cxx10
-rw-r--r--xmloff/source/forms/elementimport.cxx2
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx12
-rw-r--r--xmloff/source/text/XMLTextFrameHyperlinkContext.cxx6
-rw-r--r--xmloff/source/text/txtimp.cxx18
-rw-r--r--xmloff/source/text/txtparaimphint.hxx24
73 files changed, 356 insertions, 352 deletions
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index 4f20a781c676..aac36d257b35 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -115,7 +115,7 @@ void MediaToolBoxControl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eSta
{
pCtrl->Enable( true, false );
- const MediaItem* pMediaItem = PTR_CAST( MediaItem, pState );
+ const MediaItem* pMediaItem = dynamic_cast<const MediaItem*>( pState );
if( pMediaItem && ( SfxItemState::DEFAULT == eState ) )
pCtrl->setState( *pMediaItem );
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index be6a02ec8111..b060c6248998 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1151,8 +1151,8 @@ OUString EditorWindow::GetActualSubName( sal_uLong nLine )
SbxArrayRef pMethods = rModulWindow.GetSbModule()->GetMethods();
for( sal_uInt16 i=0; i < pMethods->Count(); i++ )
{
- SbxVariable* p = PTR_CAST( SbMethod, pMethods->Get( i ) );
- SbMethod* pMeth = PTR_CAST( SbMethod, p );
+ SbxVariable* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
+ SbMethod* pMeth = dynamic_cast<SbMethod*>( p );
if( pMeth )
{
sal_uInt16 l1,l2;
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;
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 7bfc2990a2aa..d8bf3d37b6c7 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1474,18 +1474,18 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet* rSet )
const SfxPoolItem* pMacroItem=0;
if( SfxItemState::SET == rSet->GetItemState( SID_MACROINFO, true, &pMacroItem ) )
{
- m_pMacroInfoItem = PTR_CAST( SfxMacroInfoItem, pMacroItem );
+ m_pMacroInfoItem = dynamic_cast<const SfxMacroInfoItem*>( pMacroItem );
m_pGroupLBox->SelectMacro( m_pMacroInfoItem );
}
else
{
const SfxPoolItem* pStringItem=0;
if( SfxItemState::SET == rSet->GetItemState( SID_CHARMAP, true, &pStringItem ) )
- m_pStringItem = PTR_CAST( SfxStringItem, pStringItem );
+ m_pStringItem = dynamic_cast<const SfxStringItem*>( pStringItem );
const SfxPoolItem* pFontItem=0;
if( SfxItemState::SET == rSet->GetItemState( SID_ATTR_SPECIALCHAR, true, &pFontItem ) )
- m_pFontItem = PTR_CAST( SfxStringItem, pFontItem );
+ m_pFontItem = dynamic_cast<const SfxStringItem*>( pFontItem );
}
}
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index e4d4b0a664db..e35ed0bc1c6c 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -358,7 +358,7 @@ void SvxHyperlinkNewDocTp::DoApply ()
&aFrame, &aReferer, 0L );
// save new doc
- const SfxViewFrameItem *pItem = PTR_CAST( SfxViewFrameItem, pReturn ); // SJ: pReturn is NULL if the Hyperlink
+ const SfxViewFrameItem *pItem = dynamic_cast<const SfxViewFrameItem*>( pReturn ); // SJ: pReturn is NULL if the Hyperlink
if ( pItem ) // creation is cancelled #106216#
{
pViewFrame = pItem->GetFrame();
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 0e8453296652..42c77ea01624 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -203,7 +203,7 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
const SfxPoolItem& rItem = mrSet.Get(mrSet.GetPool()->GetWhich(SID_ATTR_ZOOM));
- if (rItem.ISA(SvxZoomItem))
+ if (0 != dynamic_cast<const SvxZoomItem*>( &rItem))
{
const SvxZoomItem& rZoomItem = static_cast<const SvxZoomItem&>(rItem);
const sal_uInt16 nZoom = rZoomItem.GetValue();
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 12e6b5dcffc6..1e37184959b4 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -296,7 +296,7 @@ bool SvxChartColorTableItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rAttr ), "SvxChartColorTableItem::operator== : types differ" );
- const SvxChartColorTableItem * rCTItem( dynamic_cast< const SvxChartColorTableItem * >( & rAttr ));
+ const SvxChartColorTableItem * rCTItem( dynamic_cast<const SvxChartColorTableItem * >( & rAttr ));
if( rCTItem )
{
return (this->m_aColorTable == rCTItem->GetColorList());
diff --git a/cui/source/options/connpoolsettings.cxx b/cui/source/options/connpoolsettings.cxx
index b735076835b7..cb42a3a36bdd 100644
--- a/cui/source/options/connpoolsettings.cxx
+++ b/cui/source/options/connpoolsettings.cxx
@@ -53,7 +53,7 @@ namespace offapp
bool DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
{
- const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
+ const DriverPoolingSettingsItem* pItem = dynamic_cast<const DriverPoolingSettingsItem*>( &_rCompare );
if (!pItem)
return false;
diff --git a/cui/source/options/dbregistersettings.cxx b/cui/source/options/dbregistersettings.cxx
index f3fca6a033f2..75f71d57e10d 100644
--- a/cui/source/options/dbregistersettings.cxx
+++ b/cui/source/options/dbregistersettings.cxx
@@ -36,7 +36,7 @@ namespace svx
bool DatabaseMapItem::operator==( const SfxPoolItem& _rCompare ) const
{
- const DatabaseMapItem* pItem = PTR_CAST(DatabaseMapItem, &_rCompare);
+ const DatabaseMapItem* pItem = dynamic_cast<const DatabaseMapItem*>( &_rCompare );
if ( !pItem )
return false;
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 5c582919fb78..79e037c9d467 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -359,8 +359,7 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
bModified = true;
}
- const SfxUInt16Item* pUInt16Item =
- PTR_CAST( SfxUInt16Item, GetOldItem( *rSet, SID_ATTR_YEAR2000 ) );
+ const SfxUInt16Item* pUInt16Item = dynamic_cast< const SfxUInt16Item* >( GetOldItem( *rSet, SID_ATTR_YEAR2000 ) );
sal_uInt16 nNum = (sal_uInt16)m_pYearValueField->GetText().toInt32();
if ( pUInt16Item && pUInt16Item->GetValue() != nNum )
{
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index e8b45bbb1a6f..113ccae31a31 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1717,7 +1717,7 @@ bool SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt )
{
if(rNEvt.GetType()==MouseNotifyEvent::LOSEFOCUS)
{
- if ( rNEvt.GetWindow() == dynamic_cast< vcl::Window* >( m_pEdComment.get() ) && !m_pEdComment->IsVisible() )
+ if ( rNEvt.GetWindow() == dynamic_cast<const vcl::Window* >( m_pEdComment.get() ) && !m_pEdComment->IsVisible() )
{
pLastActivWindow = NULL;
}
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index e466a09208d7..3b4e7eaa58e0 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -140,7 +140,7 @@ void SvxLineEndDefTabPage::Construct()
{
bCreateArrowPossible = false;
}
- else if( !pPolyObj->ISA( SdrPathObj ) )
+ else if( 0 == dynamic_cast<const SdrPathObj*>( pPolyObj) )
{
SdrObjTransformInfoRec aInfoRec;
pPolyObj->TakeObjInfo( aInfoRec );
@@ -148,7 +148,7 @@ void SvxLineEndDefTabPage::Construct()
if( aInfoRec.bCanConvToPath )
pNewObj = pPolyObj->ConvertToPolyObj( true, false );
- bCreateArrowPossible = pNewObj && pNewObj->ISA( SdrPathObj );
+ bCreateArrowPossible = pNewObj && 0 != dynamic_cast<const SdrPathObj*>( pNewObj);
SdrObject::Free( pNewObj );
}
@@ -407,7 +407,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void)
const SdrObject* pNewObj;
SdrObject* pConvPolyObj = NULL;
- if( pPolyObj->ISA( SdrPathObj ) )
+ if( 0 != dynamic_cast<const SdrPathObj*>( pPolyObj) )
{
pNewObj = pPolyObj;
}
@@ -420,7 +420,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void)
{
pNewObj = pConvPolyObj = pPolyObj->ConvertToPolyObj( true, false );
- if( !pNewObj || !pNewObj->ISA( SdrPathObj ) )
+ if( !pNewObj || 0 == dynamic_cast<const SdrPathObj*>( pNewObj) )
return; // cancel, additional safety, which
// has no use for group objects though.
}
diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx
index 247dc75a2797..7283b1e9703b 100644
--- a/dbaccess/source/filter/xml/xmlColumn.cxx
+++ b/dbaccess/source/filter/xml/xmlColumn.cxx
@@ -130,7 +130,8 @@ void OXMLColumn::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName)));
+ OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(
+ dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName)));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(xProp);
@@ -142,7 +143,7 @@ void OXMLColumn::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName)));
+ OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast<const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName)));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(xProp);
@@ -159,7 +160,7 @@ void OXMLColumn::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName)));
+ OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName)));
if ( pAutoStyle )
{
// we also have to do this on the table to import text-properties
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx
index 1671f2f99c26..ef19d1b1953c 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.cxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx
@@ -83,13 +83,13 @@ void OTableStyleContext::FillPropertySet(
{
if ((m_nNumberFormat == -1) && !m_sDataStyleName.isEmpty())
{
- SvXMLNumFormatContext* pStyle = const_cast<SvXMLNumFormatContext*>(PTR_CAST(SvXMLNumFormatContext,pStyles->FindStyleChildContext(
+ SvXMLNumFormatContext* pStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext* >(pStyles->FindStyleChildContext(
XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true)));
if ( !pStyle )
{
- OTableStylesContext* pMyStyles = PTR_CAST(OTableStylesContext,GetOwnImport().GetAutoStyles());
+ OTableStylesContext* pMyStyles = dynamic_cast<OTableStylesContext* >(GetOwnImport().GetAutoStyles());
if ( pMyStyles )
- pStyle = const_cast<SvXMLNumFormatContext*>(PTR_CAST(SvXMLNumFormatContext,pMyStyles->
+ pStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext* >(pMyStyles->
FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true)));
else {
OSL_FAIL("not possible to get style");
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index c2cc44be3c4d..7af6b199e04a 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -193,7 +193,7 @@ void OXMLTable::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName)));
+ OTableStyleContext* pAutoStyle = const_cast<OTableStyleContext*>(dynamic_cast< const OTableStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName)));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(m_xTable);
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index b0b8d6bce908..7f845cfc1c1c 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1477,7 +1477,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const
case ID_BROWSER_CUT:
{
CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller();
- if (xCurrentController.Is() && xCurrentController->ISA(EditCellController))
+ if (xCurrentController.Is() && 0 != dynamic_cast< const EditCellController* >(xCurrentController.get()))
{
Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow());
bool bHasLen = (rEdit.GetSelection().Len() != 0);
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index deb636a6eded..3ccf87831ac4 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -1395,7 +1395,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt )
ActivateCell();
CellControllerRef xCurrentController = Controller();
- if (!xCurrentController.Is() || !xCurrentController->ISA(EditCellController))
+ if (!xCurrentController.Is() || 0 == dynamic_cast< const EditCellController* >(xCurrentController.get()))
return DND_ACTION_NONE;
Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow());
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index a28fd3a9b402..7bfbd70c58a8 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -98,7 +98,7 @@ namespace dbaui
get(m_pPB_CreateDB, "create");
// extract the datasource type collection from the item set
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rCoreAttrs.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rCoreAttrs.GetItem(DSID_TYPECOLLECTION) );
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
m_pPB_Connection->SetClickHdl(LINK(this, OConnectionHelper, OnBrowseConnections));
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 5284f1c3e543..5029c632e7e3 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -182,7 +182,7 @@ using namespace ::com::sun::star;
if ( m_pETHostServer->IsValueChangedFromSaved() )
{
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rSet->GetItem(DSID_TYPECOLLECTION) );
::dbaccess::ODsnTypeCollection* pCollection = NULL;
if (pCollectionItem)
pCollection = pCollectionItem->getCollection();
@@ -279,7 +279,7 @@ using namespace ::com::sun::star;
void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/)
{
// show the "Connect directly" option only if the driver is installed
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rSet.GetItem(DSID_TYPECOLLECTION) );
bool bHasMySQLNative = ( pCollectionItem != NULL ) && pCollectionItem->getCollection()->hasDriver( "sdbc:mysqlc:" );
if ( bHasMySQLNative )
m_pNATIVEDatabase->Show();
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 6f248f4ba251..08bd5f070712 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -839,11 +839,11 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem*
// translate the SfxPoolItem
Any aValue;
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, _pItem );
- const SfxBoolItem* pBoolItem = PTR_CAST( SfxBoolItem, _pItem );
- const OptionalBoolItem* pOptBoolItem = PTR_CAST( OptionalBoolItem, _pItem );
- const SfxInt32Item* pInt32Item = PTR_CAST( SfxInt32Item, _pItem );
- const OStringListItem* pStringListItem = PTR_CAST( OStringListItem, _pItem );
+ const SfxStringItem* pStringItem = dynamic_cast<const SfxStringItem*>( _pItem );
+ const SfxBoolItem* pBoolItem = dynamic_cast<const SfxBoolItem*>( _pItem );
+ const OptionalBoolItem* pOptBoolItem = dynamic_cast<const OptionalBoolItem*>( _pItem );
+ const SfxInt32Item* pInt32Item = dynamic_cast< const SfxInt32Item* >( _pItem );
+ const OStringListItem* pStringListItem = dynamic_cast<const OStringListItem*>( _pItem );
if ( pStringItem )
{
@@ -1113,7 +1113,7 @@ DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSour
bool DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const
{
- const DbuTypeCollectionItem* pCompare = PTR_CAST(DbuTypeCollectionItem, &_rItem);
+ const DbuTypeCollectionItem* pCompare = dynamic_cast<const DbuTypeCollectionItem*>( &_rItem );
return pCompare && (pCompare->getCollection() == getCollection());
}
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 0f6e7bc6985f..2c2dbbef65d7 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -105,7 +105,7 @@ namespace dbaui
// check whether this must be a tristate check box
const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId );
- if ( rItem.ISA( OptionalBoolItem ) )
+ if ( 0 != dynamic_cast< const OptionalBoolItem* >(&rItem) )
(*setting->ppControl)->EnableTriState();
}
}
@@ -253,11 +253,11 @@ namespace dbaui
aValue.reset();
SFX_ITEMSET_GET( _rSet, pItem, SfxPoolItem, setting->nItemId, true );
- if (const SfxBoolItem *pBoolItem = PTR_CAST(SfxBoolItem, pItem))
+ if (const SfxBoolItem *pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
{
aValue.reset( pBoolItem->GetValue() );
}
- else if (const OptionalBoolItem *pOptionalItem = PTR_CAST(OptionalBoolItem, pItem))
+ else if (const OptionalBoolItem *pOptionalItem = dynamic_cast<const OptionalBoolItem*>( pItem) )
{
aValue = pOptionalItem->GetFullValue();
}
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 5d69c14af6f7..0522cb302442 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -109,7 +109,7 @@ void ODbAdminDialog::impl_selectDataSource(const css::uno::Any& _aDataSourceName
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
impl_resetPages( xDatasource );
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( getOutputSet()->GetItem(DSID_TYPECOLLECTION) );
::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
::dbaccess::DATASOURCE_TYPE eType = pCollection->determineType(getDatasourceType(*getOutputSet()));
@@ -200,7 +200,7 @@ void ODbAdminDialog::impl_resetPages(const Reference< XPropertySet >& _rxDatasou
// special case: MySQL Native does not have the generic "advanced" page
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( getOutputSet()->GetItem(DSID_TYPECOLLECTION) );
::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
if ( pCollection->determineType(getDatasourceType( *pExampleSet )) == ::dbaccess::DST_MYSQL_NATIVE )
{
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index 2dd1f1033a68..f8e925ee3f7e 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -93,7 +93,7 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent
m_pHelp->SetUniqueId(UID_DBWIZ_HELP);
// no local resources needed anymore
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _pItems->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _pItems->GetItem(DSID_TYPECOLLECTION) );
m_pCollection = pCollectionItem->getCollection();
ActivatePage();
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index cc4efd81d651..151044a55a95 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -135,7 +135,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent
{
// no local resources needed anymore
// extract the datasource type collection from the item set
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _pItems->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _pItems->GetItem(DSID_TYPECOLLECTION) );
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 5af2be90980d..7286e93acb0c 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -65,7 +65,7 @@ namespace dbaui
get( m_pSpecialMessage, "specialMessage" );
// extract the datasource type collection from the item set
- const DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rItems.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rItems.GetItem(DSID_TYPECOLLECTION) );
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
SAL_WARN_IF(!m_pCollection, "dbaccess", "OGeneralPage::OGeneralPage : really need a DSN type collection !");
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.cxx b/dbaccess/source/ui/dlg/optionalboolitem.cxx
index 76086d9ddc4f..bfdc2cfe8923 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.cxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.cxx
@@ -38,7 +38,7 @@ namespace dbaui
bool OptionalBoolItem::operator==( const SfxPoolItem& _rItem ) const
{
- const OptionalBoolItem* pCompare = PTR_CAST( OptionalBoolItem, &_rItem );
+ const OptionalBoolItem* pCompare = dynamic_cast<const OptionalBoolItem*>( &_rItem );
if ( !pCompare )
return false;
diff --git a/dbaccess/source/ui/misc/propertysetitem.cxx b/dbaccess/source/ui/misc/propertysetitem.cxx
index a527faa11da7..92024d2b3954 100644
--- a/dbaccess/source/ui/misc/propertysetitem.cxx
+++ b/dbaccess/source/ui/misc/propertysetitem.cxx
@@ -46,7 +46,7 @@ namespace dbaui
bool OPropertySetItem::operator==(const SfxPoolItem& _rItem) const
{
- const OPropertySetItem* pCompare = PTR_CAST(OPropertySetItem, &_rItem);
+ const OPropertySetItem* pCompare = dynamic_cast<const OPropertySetItem*>( &_rItem );
if ((!pCompare) || (pCompare->m_xSet.get() != m_xSet.get()))
return false;
diff --git a/dbaccess/source/ui/misc/stringlistitem.cxx b/dbaccess/source/ui/misc/stringlistitem.cxx
index d375d8669f07..2663db4746c3 100644
--- a/dbaccess/source/ui/misc/stringlistitem.cxx
+++ b/dbaccess/source/ui/misc/stringlistitem.cxx
@@ -40,7 +40,7 @@ OStringListItem::OStringListItem(const OStringListItem& _rSource)
bool OStringListItem::operator==(const SfxPoolItem& _rItem) const
{
- const OStringListItem* pCompare = PTR_CAST(OStringListItem, &_rItem);
+ const OStringListItem* pCompare = dynamic_cast<const OStringListItem*>( &_rItem );
if ((!pCompare) || (pCompare->m_aList.getLength() != m_aList.getLength()))
return false;
diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index d47ff8f67ca8..ad46c8b28ad4 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -275,7 +275,7 @@ void TextUndoInsertChars::Redo()
bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
{
- if ( !pNextAction->ISA( TextUndoInsertChars ) )
+ if ( 0 == dynamic_cast< const TextUndoInsertChars*>( pNextAction ) )
return false;
TextUndoInsertChars* pNext = static_cast<TextUndoInsertChars*>(pNextAction);
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index 502ef0838965..8377650bf221 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -227,7 +227,7 @@ void SchXMLAxisContext::CreateGrid( const OUString& sAutoStyleName, bool bIsMajo
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast<const XMLPropStyleContext*>( pStyle) != nullptr)
const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ))->FillPropertySet( xGridProp );
}
}
@@ -473,7 +473,7 @@ void SchXMLAxisContext::CreateAxis()
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), m_aAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast<const XMLPropStyleContext*>( pStyle) != nullptr)
{
// note: SvXMLStyleContext::FillPropertySet is not const
XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 6902828681dd..b5ddec55667a 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -373,7 +373,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) != nullptr)
const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ) )->FillPropertySet( xProp );
}
}
@@ -1199,7 +1199,7 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), msAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) != nullptr)
const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ) )->FillPropertySet( xProp );
}
}
diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx
index 80e829d98d7d..c58048b52a2d 100644
--- a/xmloff/source/chart/SchXMLLegendContext.cxx
+++ b/xmloff/source/chart/SchXMLLegendContext.cxx
@@ -206,7 +206,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) != nullptr)
const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xLegendProps );
}
}
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 06e8771172d9..58a5644294e6 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -840,7 +840,7 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) != nullptr)
const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xProp );
}
}
@@ -910,7 +910,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext*>(pStyle) != nullptr)
const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xProp );
}
}
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 7a56898e6d61..dd74df96989a 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -708,7 +708,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
{
pContext = CreateContext( nPrefix, aLocalName, xAttrList );
if( (nPrefix & XML_NAMESPACE_UNKNOWN_FLAG) != 0 &&
- IS_TYPE( SvXMLImportContext, pContext ) )
+ dynamic_cast< const SvXMLImportContext*>(pContext ) != nullptr )
{
OUString aMsg( "Root element unknown" );
Reference<xml::sax::XLocator> xDummyLocator;
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 52fb0824ad5a..28708168342d 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -702,7 +702,7 @@ SvXMLImportContext *XMLShapeImportHelper::CreateFrameChildContext(
{
SvXMLImportContext * pContext = NULL;
- SdXMLFrameShapeContext *pFrameContext = PTR_CAST( SdXMLFrameShapeContext, pThisContext );
+ SdXMLFrameShapeContext *pFrameContext = dynamic_cast<SdXMLFrameShapeContext*>( pThisContext );
if( pFrameContext )
pContext = pFrameContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 25f7e66eef2c..046e0164d172 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -355,7 +355,7 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
{
const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetAutoStylesContext();
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
+ if( pContext && dynamic_cast<const SdXMLStylesContext *>( pContext) != nullptr)
{
const SdXMLStylesContext* pStyles = static_cast<const SdXMLStylesContext*>(pContext);
if(pStyles)
@@ -363,7 +363,7 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext(
XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, rStyleName);
- if(pStyle && pStyle->ISA(XMLPropStyleContext))
+ if(pStyle && dynamic_cast<const XMLPropStyleContext*>(pStyle))
{
const XMLPropStyleContext* pPropStyle = static_cast<const XMLPropStyleContext*>(pStyle);
@@ -420,14 +420,14 @@ void SdXMLGenericPageContext::SetLayout()
const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
+ if( pContext && dynamic_cast<const SdXMLStylesContext *>( pContext ) != nullptr)
{
const SdXMLStylesContext* pStyles = static_cast<const SdXMLStylesContext*>(pContext);
if(pStyles)
{
const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName);
- if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
+ if(pStyle && dynamic_cast<const SdXMLPresentationPageLayoutContext*>( pStyle) != nullptr)
{
const SdXMLPresentationPageLayoutContext* pLayout = static_cast<const SdXMLPresentationPageLayoutContext*>(pStyle);
nType = pLayout->GetTypeId();
@@ -489,7 +489,7 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
const SvXMLStyleContext* pStyle = pAutoStyles ? pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID, rsPageMasterName) : NULL;
- if(pStyle && pStyle->ISA(SdXMLPageMasterContext))
+ if(pStyle && dynamic_cast<const SdXMLPageMasterContext*>(pStyle) != nullptr)
{
const SdXMLPageMasterContext* pPageMaster = static_cast<const SdXMLPageMasterContext*>(pStyle);
const SdXMLPageMasterStyleContext* pPageMasterContext = pPageMaster->GetPageMasterStyle();
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index df01ab67436f..3a05256e5c90 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -630,9 +630,9 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
OUString aStyleName = maDrawStyleName;
uno::Reference< style::XStyle > xStyle;
- if( pStyle && pStyle->ISA(XMLShapeStyleContext) )
+ if( pStyle && dynamic_cast<const XMLShapeStyleContext*>( pStyle ) != nullptr)
{
- pDocStyle = const_cast<XMLShapeStyleContext*>(PTR_CAST( XMLShapeStyleContext, pStyle ));
+ pDocStyle = const_cast<XMLShapeStyleContext*>(dynamic_cast<const XMLShapeStyleContext*>( pStyle ) );
if( pDocStyle->GetStyle().is() )
{
@@ -733,7 +733,7 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
break;
const SvXMLStyleContext* pTempStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(XML_STYLE_FAMILY_TEXT_PARAGRAPH, maTextStyleName);
- XMLPropStyleContext* pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST( XMLPropStyleContext, pTempStyle )); // use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
+ XMLPropStyleContext* pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext*>( pTempStyle ) ); // use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
if( pStyle == NULL )
break;
@@ -3589,7 +3589,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
// read replacement image
SvXMLImportContext *pImplContext = &mxImplContext;
SdXMLShapeContext *pSContext =
- PTR_CAST( SdXMLShapeContext, pImplContext );
+ dynamic_cast<SdXMLShapeContext*>( pImplContext );
if( pSContext )
{
uno::Reference < beans::XPropertySet > xPropSet(
@@ -3610,7 +3610,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
IsXMLToken( rLocalName, XML_THUMBNAIL ) ) ) )
{
SvXMLImportContext *pImplContext = &mxImplContext;
- pContext = PTR_CAST( SdXMLShapeContext, pImplContext )->CreateChildContext( nPrefix,
+ pContext = dynamic_cast<SdXMLShapeContext*>( pImplContext )->CreateChildContext( nPrefix,
rLocalName, xAttrList );
}
else if ( (XML_NAMESPACE_DRAW == nPrefix) && IsXMLToken( rLocalName, XML_IMAGE_MAP ) )
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index a490221f8010..ab875673d182 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -224,7 +224,7 @@ void SdXMLDrawingPageStyleContext::Finish( bool bOverwrite )
sal_Int32 nStyle = 0;
const SdXMLNumberFormatImportContext* pSdNumStyle =
- PTR_CAST( SdXMLNumberFormatImportContext,
+ dynamic_cast< const SdXMLNumberFormatImportContext*> (
GetStyles()->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, sStyleName, true ) );
if( pSdNumStyle )
@@ -879,7 +879,7 @@ void SdXMLMasterPageContext::EndElement()
if(!msName.isEmpty() && GetSdImport().GetShapeImport()->GetStylesContext())
{
SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
+ if( dynamic_cast<const SdXMLStylesContext*>(pContext) != nullptr )
static_cast<SdXMLStylesContext*>(pContext)->SetMasterPageStyles(*this);
}
@@ -1150,7 +1150,7 @@ void SdXMLStylesContext::EndElement()
for(sal_uInt32 a(0L); a < GetStyleCount(); a++)
{
const SvXMLStyleContext* pStyle = GetStyle(a);
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
+ if(pStyle && dynamic_cast<const XMLShapeStyleContext*>(pStyle) != nullptr)
{
const XMLShapeStyleContext* pDocStyle = static_cast<const XMLShapeStyleContext*>(pStyle);
@@ -1159,7 +1159,7 @@ void SdXMLStylesContext::EndElement()
{
pStyle = pStylesContext->FindStyleChildContext(pStyle->GetFamily(), pStyle->GetParentName());
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
+ if(pStyle && dynamic_cast<const XMLShapeStyleContext*>(pStyle) != nullptr)
{
const XMLShapeStyleContext* pParentStyle = static_cast<const XMLShapeStyleContext*>(pStyle);
if(pParentStyle->GetStyle().is())
@@ -1458,7 +1458,7 @@ uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() co
for(sal_uInt32 a(0L); a < GetStyleCount(); a++)
{
const SvXMLStyleContext* pStyle = GetStyle(a);
- if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
+ if(pStyle && dynamic_cast<const SdXMLPresentationPageLayoutContext*>(pStyle) != nullptr)
{
xLayouts->insertByName( pStyle->GetName(), uno::makeAny(
(sal_Int32)static_cast<const SdXMLPresentationPageLayoutContext*>(pStyle)->GetTypeId() ) );
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 859f1d0c9d13..dc4f424aab13 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -598,7 +598,7 @@ namespace xmloff
const SvXMLStyleContext* pStyleContext = m_rContext.getStyleElement( _rValue );
OSL_ENSURE( pStyleContext, "OElementImport::handleAttribute: do not know the style!" );
// remember the element for later usage.
- m_pStyleElement = PTR_CAST( XMLTextStyleContext, pStyleContext );
+ m_pStyleElement = dynamic_cast<const XMLTextStyleContext*>( pStyleContext );
return true;
}
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index 0efac45022cc..a4ed61ae25ca 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -404,7 +404,7 @@ bool XMLFontStylesContext::FillProperties( const OUString& rName,
sal_Int32 nCharsetIdx ) const
{
const SvXMLStyleContext* pStyle = FindStyleChildContext( XML_STYLE_FAMILY_FONT, rName, true );
- const XMLFontStyleContextFontFace *pFontStyle = PTR_CAST( XMLFontStyleContextFontFace,pStyle);// use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
+ const XMLFontStyleContextFontFace *pFontStyle = dynamic_cast<const XMLFontStyleContextFontFace*>(pStyle);// use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
if( pFontStyle )
pFontStyle->FillProperties( rProps, nFamilyNameIdx, nStyleNameIdx,
nFamilyIdx, nPitchIdx, nCharsetIdx );
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index d318b3292773..4368407e05a0 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1362,7 +1362,7 @@ bool XMLTextFrameContext::CreateIfNotThere( ::com::sun::star::uno::Reference <
::com::sun::star::beans::XPropertySet >& rPropSet )
{
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl*>( pContext );
if( pImpl )
{
if( pImpl->CreateIfNotThere() )
@@ -1442,7 +1442,7 @@ void XMLTextFrameContext::EndElement()
SvXMLImportContext const*const pContext =
(pMultiContext) ? &pMultiContext : &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = const_cast<XMLTextFrameContext_Impl*>(PTR_CAST( XMLTextFrameContext_Impl, pContext ));
+ XMLTextFrameContext_Impl *pImpl = const_cast<XMLTextFrameContext_Impl*>(dynamic_cast< const XMLTextFrameContext_Impl*>( pContext ));
assert(!pMultiContext || pImpl);
if( pImpl )
{
@@ -1593,7 +1593,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
m_xReplImplContext = pContext;
}
}
- else if( m_xImplContext->ISA( XMLTextFrameContext_Impl ) )
+ else if( 0 != dynamic_cast< const XMLTextFrameContext_Impl*>( m_xImplContext.get() ))
{
// the child is a writer frame
if( XML_NAMESPACE_SVG == p_nPrefix )
@@ -1698,7 +1698,7 @@ void XMLTextFrameContext::SetHyperlink( const OUString& rHRef,
TextContentAnchorType XMLTextFrameContext::GetAnchorType() const
{
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl*>( pContext );
if( pImpl )
return pImpl->GetAnchorType();
else
@@ -1709,7 +1709,7 @@ Reference < XTextContent > XMLTextFrameContext::GetTextContent() const
{
Reference < XTextContent > xTxtCntnt;
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
if( pImpl )
xTxtCntnt.set( pImpl->GetPropSet(), UNO_QUERY );
@@ -1720,7 +1720,7 @@ Reference < XShape > XMLTextFrameContext::GetShape() const
{
Reference < XShape > xShape;
SvXMLImportContext* pContext = &m_xImplContext;
- SvXMLShapeContext* pImpl = PTR_CAST( SvXMLShapeContext, pContext );
+ SvXMLShapeContext* pImpl = dynamic_cast<SvXMLShapeContext*>( pContext );
if ( pImpl )
{
xShape = pImpl->getShape();
diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
index 1e76bd351ec4..fa346909fb32 100644
--- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
+++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
@@ -138,7 +138,7 @@ TextContentAnchorType XMLTextFrameHyperlinkContext::GetAnchorType() const
if( xFrameContext.Is() )
{
SvXMLImportContext *pContext = &xFrameContext;
- return PTR_CAST( XMLTextFrameContext, pContext ) ->GetAnchorType();
+ return dynamic_cast<XMLTextFrameContext*>( pContext ) ->GetAnchorType( );
}
else
return eDefaultAnchorType;
@@ -151,7 +151,7 @@ Reference < XTextContent > XMLTextFrameHyperlinkContext::GetTextContent() const
if( xFrameContext.Is() )
{
SvXMLImportContext *pContext = &xFrameContext;
- xTxt = PTR_CAST( XMLTextFrameContext, pContext )->GetTextContent();
+ xTxt = dynamic_cast<XMLTextFrameContext*>( pContext )->GetTextContent( );
}
return xTxt;
@@ -164,7 +164,7 @@ Reference < drawing::XShape > XMLTextFrameHyperlinkContext::GetShape() const
if( xFrameContext.Is() )
{
SvXMLImportContext *pContext = &xFrameContext;
- xShape = PTR_CAST( XMLTextFrameContext, pContext )->GetShape();
+ xShape = dynamic_cast<XMLTextFrameContext*>( pContext )->GetShape( );
}
return xShape;
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 061c2be52221..0e014cc396f9 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1212,7 +1212,7 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
static_cast<SvXMLStylesContext *>(&m_xImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, rStyleName,
true );
- pStyle = const_cast<XMLTextStyleContext*>(PTR_CAST( XMLTextStyleContext,pTempStyle));
+ pStyle = const_cast<XMLTextStyleContext*>( dynamic_cast< const XMLTextStyleContext* >(pTempStyle));
}
if( pStyle )
@@ -1421,7 +1421,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
const SvXMLStyleContext* pTempStyle =
static_cast<SvXMLStylesContext *>(&m_xImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, sStyleName, true );
- pStyle = const_cast<XMLTextStyleContext*>(PTR_CAST( XMLTextStyleContext,pTempStyle));
+ pStyle = const_cast<XMLTextStyleContext*>(dynamic_cast< const XMLTextStyleContext* >(pTempStyle));
}
if( pStyle )
sStyleName = pStyle->GetParentName();
@@ -2108,7 +2108,7 @@ void XMLTextImportHelper::SetRuby(
static_cast<SvXMLStylesContext *>(&m_xImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY,
rStyleName, true );
- XMLPropStyleContext *pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pTempStyle));
+ XMLPropStyleContext *pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
if (NULL != pStyle)
pStyle->FillPropertySet( xPropSet );
@@ -2349,14 +2349,14 @@ sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
// first check if it's a impress and draw only number format
// this is needed since its also a SvXMLNumFormatContext,
// that was needed to support them for controls in impress/draw also
- const SdXMLNumberFormatImportContext* pSdNumStyle = PTR_CAST( SdXMLNumberFormatImportContext, pStyle );
+ const SdXMLNumberFormatImportContext* pSdNumStyle = dynamic_cast<const SdXMLNumberFormatImportContext*>( pStyle );
if( pSdNumStyle )
{
return pSdNumStyle->GetDrawKey();
}
else
{
- SvXMLNumFormatContext* pNumStyle = const_cast<SvXMLNumFormatContext*>(PTR_CAST( SvXMLNumFormatContext, pStyle ));
+ SvXMLNumFormatContext* pNumStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast<const SvXMLNumFormatContext*>( pStyle ) );
if( pNumStyle )
{
if( pIsSystemLanguage != NULL )
@@ -2378,7 +2378,7 @@ const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUSt
static_cast<SvXMLStylesContext *>(&m_xImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_LIST, rName,
true );
- pStyle = PTR_CAST( SvxXMLListStyleContext ,pTempStyle);
+ pStyle = dynamic_cast< const SvxXMLListStyleContext* >(pTempStyle);
}
return pStyle;
@@ -2393,7 +2393,7 @@ XMLPropStyleContext *XMLTextImportHelper::FindAutoFrameStyle( const OUString& rN
static_cast<SvXMLStylesContext *>(&m_xImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, rName,
true );
- pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST( XMLPropStyleContext ,pTempStyle));
+ pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
}
return pStyle;
@@ -2410,7 +2410,7 @@ XMLPropStyleContext* XMLTextImportHelper::FindSectionStyle(
FindStyleChildContext(
XML_STYLE_FAMILY_TEXT_SECTION,
rName, true );
- pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST( XMLPropStyleContext,pTempStyle));
+ pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
}
return pStyle;
@@ -2427,7 +2427,7 @@ XMLPropStyleContext* XMLTextImportHelper::FindPageMaster(
FindStyleChildContext(
XML_STYLE_FAMILY_PAGE_MASTER,
rName, true );
- pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST( XMLPropStyleContext,pTempStyle));
+ pStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pTempStyle));
}
return pStyle;
diff --git a/xmloff/source/text/txtparaimphint.hxx b/xmloff/source/text/txtparaimphint.hxx
index 5b28d9966d08..a46ad8bbc96f 100644
--- a/xmloff/source/text/txtparaimphint.hxx
+++ b/xmloff/source/text/txtparaimphint.hxx
@@ -205,10 +205,10 @@ public:
{
css::uno::Reference < css::text::XTextContent > xTxt;
SvXMLImportContext *pContext = &xContext;
- if( pContext->ISA( XMLTextFrameContext ) )
- xTxt = PTR_CAST( XMLTextFrameContext, pContext )->GetTextContent();
- else if( pContext->ISA( XMLTextFrameHyperlinkContext ) )
- xTxt = PTR_CAST( XMLTextFrameHyperlinkContext, pContext )
+ if( 0 != dynamic_cast<const XMLTextFrameContext*>(pContext) )
+ xTxt = dynamic_cast< XMLTextFrameContext*>( pContext )->GetTextContent();
+ else if( 0 != dynamic_cast<const XMLTextFrameHyperlinkContext*>(pContext) )
+ xTxt = dynamic_cast< XMLTextFrameHyperlinkContext* >( pContext )
->GetTextContent();
return xTxt;
@@ -219,10 +219,10 @@ public:
{
css::uno::Reference < css::drawing::XShape > xShape;
SvXMLImportContext *pContext = &xContext;
- if( pContext->ISA( XMLTextFrameContext ) )
- xShape = PTR_CAST( XMLTextFrameContext, pContext )->GetShape();
- else if( pContext->ISA( XMLTextFrameHyperlinkContext ) )
- xShape = PTR_CAST( XMLTextFrameHyperlinkContext, pContext )->GetShape();
+ if( 0 != dynamic_cast<const XMLTextFrameContext*>(pContext) )
+ xShape = dynamic_cast< XMLTextFrameContext*>( pContext )->GetShape();
+ else if( 0 != dynamic_cast<const XMLTextFrameHyperlinkContext*>(pContext) )
+ xShape = dynamic_cast<XMLTextFrameHyperlinkContext*>( pContext )->GetShape();
return xShape;
}
@@ -231,13 +231,13 @@ public:
{
bool bRet = false;
SvXMLImportContext *pContext = &xContext;
- if( pContext->ISA( XMLTextFrameContext ) )
+ if( 0 != dynamic_cast<const XMLTextFrameContext*>(pContext) )
bRet = css::text::TextContentAnchorType_AT_CHARACTER ==
- PTR_CAST( XMLTextFrameContext, pContext )
+ dynamic_cast<const XMLTextFrameContext*>( pContext )
->GetAnchorType();
- else if( pContext->ISA( XMLTextFrameHyperlinkContext ) )
+ else if( 0 != dynamic_cast<const XMLTextFrameHyperlinkContext*>( pContext) )
bRet = css::text::TextContentAnchorType_AT_CHARACTER ==
- PTR_CAST( XMLTextFrameHyperlinkContext, pContext )
+ dynamic_cast<const XMLTextFrameHyperlinkContext*>( pContext )
->GetAnchorType();
return bRet;
}