1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0022573: Extend the range of status values returned by the method TDocStd_Application::SaveAs

This commit is contained in:
MSV
2011-09-15 06:32:58 +00:00
committed by bugmaster
parent c345d68b3a
commit 15e8b08292
24 changed files with 305 additions and 318 deletions

View File

@@ -39,8 +39,6 @@ is
is redefined virtual;
---Purpose: Write <theDocument> to the binary file <theFileName>
IsError (me) returns Boolean from Standard;
AttributeDrivers (me : mutable; theMsgDriver: MessageDriver from CDM)
returns ADriverTable from BinMDF
is virtual;
@@ -93,7 +91,6 @@ fields
myPAtt : Persistent from BinObjMgt;
myDrivers : ADriverTable from BinMDF is protected;
myRelocTable: SRelocationTable from BinObjMgt is protected;
myIsError : Boolean from Standard is protected;
myMsgDriver : MessageDriver from CDM;
-- labels not having writable attributes on it-self and on children

View File

@@ -55,7 +55,9 @@ void BinLDrivers_DocumentStorageDriver::Write
(const Handle(CDM_Document)& theDocument,
const TCollection_ExtendedString& theFileName)
{
myIsError = Standard_False;
SetIsError(Standard_False);
SetStoreStatus(PCDM_SS_OK);
myMsgDriver = theDocument -> Application() -> MessageDriver();
myMapUnsupported.Clear();
@@ -69,7 +71,8 @@ void BinLDrivers_DocumentStorageDriver::Write
Handle(TDocStd_Document) aDoc =
Handle(TDocStd_Document)::DownCast(theDocument);
if (aDoc.IsNull()) {
myIsError = Standard_True;
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_Doc_IsNull);
}
else {
// Open the file
@@ -84,8 +87,11 @@ void BinLDrivers_DocumentStorageDriver::Write
// 1. Write info section (including types table)
WriteInfoSection(theDocument, aFileName);
myTypesMap.Clear();
if (myIsError)
return;
if (IsError())
{
SetStoreStatus(PCDM_SS_Info_Section_Error);
return;
}
#if !defined(IRIX) // 10.10.2005
ofstream anOS (aFileName.ToCString(), ios::in | ios::binary | ios::ate);
@@ -140,7 +146,9 @@ void BinLDrivers_DocumentStorageDriver::Write
#ifdef DEB
WriteMessage (aMethStr + "no objects written");
#endif
myIsError = Standard_True;
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_No_Obj);
}
myRelocTable.Clear();
}
@@ -156,7 +164,8 @@ void BinLDrivers_DocumentStorageDriver::Write
anErrorStr + aMethStr + "Problem writing the file ";
WriteMessage (aStr + theFileName);
#endif
myIsError = Standard_True;
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_DiskWritingFailure);
}
}
@@ -258,16 +267,6 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
}
//=======================================================================
//function : IsError
//purpose :
//=======================================================================
Standard_Boolean BinLDrivers_DocumentStorageDriver::IsError () const
{
return myIsError;
}
//=======================================================================
//function : AttributeDrivers
//purpose :
@@ -364,7 +363,7 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
WriteMessage (TCollection_ExtendedString("Error: Cannot open file ") +
theFileName);
#endif
myIsError = Standard_True;
SetIsError(Standard_True);
return;
}
@@ -424,7 +423,7 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
WriteMessage(TCollection_ExtendedString("Error: Problem writing header "
"into file ") + theFileName);
#endif
myIsError = Standard_True;
SetIsError(Standard_True);
}
#ifdef DEB
const Standard_Integer aP = (Standard_Integer) aFileDriver.Tell();