1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0023306: Failures reading some attributes of BinOcaf document

Saving OCAF attribute TColStd_Array1OfExtendedString to binary file is corrected (missing data field written).
This commit is contained in:
szy 2012-08-20 12:56:47 +04:00
parent 9db37f0e3c
commit aa45313282

View File

@ -79,17 +79,21 @@ Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste
} }
if(ok) { if(ok) {
#ifdef DEB //#ifdef DEB
//cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl; // cout << "CurDocVersion = " << BinMDataStd::DocumentVersion() <<endl;
#endif //#endif
Standard_Boolean aDelta(Standard_False); Standard_Boolean aDelta(Standard_False);
if(BinMDataStd::DocumentVersion() > 2) { if(BinMDataStd::DocumentVersion() > 2) {
Standard_Byte aDeltaValue; Standard_Byte aDeltaValue;
if (! (theSource >> aDeltaValue)) if (! (theSource >> aDeltaValue)) {
return Standard_False; //#ifdef DEB
// cout <<"DeltaValue = " << (Standard_Integer)aDeltaValue <<endl;
//#endif
return Standard_False;
}
else else
aDelta = (Standard_Boolean)aDeltaValue; aDelta = (Standard_Boolean)aDeltaValue;
} }
anAtt->SetDelta(aDelta); anAtt->SetDelta(aDelta);
} }
return ok; return ok;
@ -113,4 +117,6 @@ void BinMDataStd_ExtStringArrayDriver::Paste
theTarget << aFirstInd << aLastInd; theTarget << aFirstInd << aLastInd;
for (Standard_Integer i = aFirstInd; i <= aLastInd; i ++) for (Standard_Integer i = aFirstInd; i <= aLastInd; i ++)
theTarget << anAtt->Value( i ); theTarget << anAtt->Value( i );
theTarget << (Standard_Byte)anAtt->GetDelta();
} }