EgtGeomKernel 2.5f6 :
- dove possibile e sicuro sostituiti dynamic_cast con static_cast.
This commit is contained in:
+9
-9
@@ -24,7 +24,7 @@ using namespace std ;
|
||||
IGdbIterator*
|
||||
CreateGdbIterator( IGeomDB* pGDB)
|
||||
{
|
||||
if ( dynamic_cast<GeomDB*>( pGDB) == nullptr)
|
||||
if ( static_cast<GeomDB*>( pGDB) == nullptr)
|
||||
return nullptr ;
|
||||
return static_cast<IGdbIterator*> ( new( nothrow) GdbIterator( pGDB)) ;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ GdbIterator::~GdbIterator( void)
|
||||
bool
|
||||
GdbIterator::SetGDB( IGeomDB* pGDB)
|
||||
{
|
||||
m_pGDB = dynamic_cast<GeomDB*>( pGDB) ;
|
||||
m_pGDB = static_cast<GeomDB*>( pGDB) ;
|
||||
if ( m_pGDB == nullptr)
|
||||
return false ;
|
||||
|
||||
@@ -105,7 +105,7 @@ GdbIterator::GoToFirstInGroup( const IGdbIterator& iIter)
|
||||
return false ;
|
||||
}
|
||||
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB) {
|
||||
m_pCurrObj = nullptr ;
|
||||
return false ;
|
||||
@@ -167,7 +167,7 @@ GdbIterator::GoToLastInGroup( const IGdbIterator& iIter)
|
||||
return false ;
|
||||
}
|
||||
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB) {
|
||||
m_pCurrObj = nullptr ;
|
||||
return false ;
|
||||
@@ -263,7 +263,7 @@ GdbIterator::GoToFirstNameInGroup( const IGdbIterator& iIter, const string& sNam
|
||||
return false ;
|
||||
}
|
||||
// converto in oggetto iteratore di base
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB) {
|
||||
m_pCurrObj = nullptr ;
|
||||
return false ;
|
||||
@@ -345,7 +345,7 @@ GdbIterator::GoToLastNameInGroup( const IGdbIterator& iIter, const string& sName
|
||||
return false ;
|
||||
}
|
||||
// converto in oggetto iteratore di base
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB) {
|
||||
m_pCurrObj = nullptr ;
|
||||
return false ;
|
||||
@@ -474,7 +474,7 @@ GdbIterator::GoToFirstGroupInGroup( const IGdbIterator& iIter)
|
||||
return false ;
|
||||
}
|
||||
// converto in oggetto iteratore di base
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB) {
|
||||
m_pCurrObj = nullptr ;
|
||||
return false ;
|
||||
@@ -553,7 +553,7 @@ GdbIterator::GoToLastGroupInGroup( const IGdbIterator& iIter)
|
||||
return false ;
|
||||
}
|
||||
// converto in oggetto iteratore di base
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB) {
|
||||
m_pCurrObj = nullptr ;
|
||||
return false ;
|
||||
@@ -1637,7 +1637,7 @@ GdbIterator::CopyAllInfoFrom( const IGdbIterator& iIter)
|
||||
return false ;
|
||||
|
||||
// recupero l'oggetto sorgente
|
||||
const GdbIterator* pIter = dynamic_cast<const GdbIterator*> (&iIter) ;
|
||||
const GdbIterator* pIter = static_cast<const GdbIterator*> (&iIter) ;
|
||||
if ( pIter == nullptr || pIter->m_pGDB != m_pGDB || pIter->m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
const GdbObj* pGdbObjSou = pIter->m_pCurrObj ;
|
||||
|
||||
Reference in New Issue
Block a user