mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027104: DownCast() cannot return null for mismatched handle
Method DownCast() is made template, to be available only when argument is actually a pointer or handle to a base class. For compatibility with existing code, method DownCast() that can be used for the same type, derived, or unrelated class (i.e. where there is no actual down casting) is still available, its use shall cause "deprecated" compiler warning. OCCT code is updated to remove meaningless DownCast()s; a few places where DownCast() was used with argument of unrelated type are corrected. DRAW command QAHandleCast is removed (it was useful only during redesign of handles).
This commit is contained in:
@@ -1268,8 +1268,7 @@ void TObj_Object::CopyReferences
|
||||
new TObj_OcafObjectIterator(GetChildLabel(), NULL, Standard_True);
|
||||
for(; aSrcChildren->More(); aSrcChildren->Next())
|
||||
{
|
||||
Handle(TObj_Object) aSrcChild =
|
||||
Handle(TObj_Object)::DownCast(aSrcChildren->Value());
|
||||
Handle(TObj_Object) aSrcChild = aSrcChildren->Value();
|
||||
TDF_Label aSrcL = aSrcChild->GetLabel();
|
||||
TDF_Label aDestLabel;
|
||||
if( !theRelocTable->HasRelocation(aSrcL, aDestLabel) )
|
||||
|
@@ -128,7 +128,7 @@ Handle(TObj_Object) TObj_TReference::Get() const
|
||||
{
|
||||
return anObject;
|
||||
}
|
||||
anObject = Handle(TObj_Object)::DownCast(aTObject->Get());
|
||||
anObject = aTObject->Get();
|
||||
return anObject;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user