mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0024280: Documentation of TObj_Model::GetFile() is incorrect
Do not throw exception when model was not stored yet
This commit is contained in:
parent
9f6931fb8a
commit
06c13a57cf
@ -224,13 +224,17 @@ Standard_Boolean TObj_Model::Load (const char* theFile)
|
|||||||
|
|
||||||
Handle(TCollection_HAsciiString) TObj_Model::GetFile() const
|
Handle(TCollection_HAsciiString) TObj_Model::GetFile() const
|
||||||
{
|
{
|
||||||
Handle(TDocStd_Document) aDoc = TDocStd_Document::Get(GetLabel());
|
Handle(TDocStd_Document) aDoc = GetDocument();
|
||||||
if ( !aDoc.IsNull() ) {
|
if ( aDoc.IsNull()
|
||||||
TCollection_AsciiString anOldPath( aDoc->GetPath() );
|
|| !aDoc->IsStored())
|
||||||
if ( !anOldPath.IsEmpty() )
|
{
|
||||||
return new TCollection_HAsciiString( anOldPath );
|
return Handle(TCollection_HAsciiString)();
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
TCollection_AsciiString aPath (aDoc->GetPath());
|
||||||
|
return !aPath.IsEmpty()
|
||||||
|
? new TCollection_HAsciiString (aPath)
|
||||||
|
: Handle(TCollection_HAsciiString)();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user