mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +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:
@@ -76,8 +76,7 @@ Standard_Boolean BinTObjDrivers_ReferenceDriver::Paste
|
||||
{
|
||||
TCollection_AsciiString aName;
|
||||
if (! (theSource >> aName)) return Standard_False;
|
||||
Handle(TObj_Model) aModel = Handle(TObj_Model)::DownCast
|
||||
( TObj_Assistant::FindModel( aName.ToCString() ));
|
||||
Handle(TObj_Model) aModel = TObj_Assistant::FindModel (aName.ToCString());
|
||||
if (aModel.IsNull())
|
||||
{
|
||||
TCollection_AsciiString anEntry;
|
||||
@@ -133,8 +132,7 @@ void BinTObjDrivers_ReferenceDriver::Paste
|
||||
if (! isSameDoc)
|
||||
{
|
||||
TCollection_AsciiString aName;
|
||||
Handle(TObj_Model) aModel =
|
||||
Handle(TObj_Model)::DownCast( aLObject->GetModel() );
|
||||
Handle(TObj_Model) aModel = aLObject->GetModel();
|
||||
aName = TCollection_AsciiString( aModel->GetModelName()->String() );
|
||||
theTarget << aName;
|
||||
}
|
||||
|
Reference in New Issue
Block a user