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

0025394: Make it possible to store/retrieve the list-based attributes containing no items

Attention! It is not a complete patch.

First patch for Binary schema.

Fix for Xml schema.

Patch for the standard schema.

Added new Draw commands to test ExtStringList & ReferenceList attributes.

Fix of a small bug in ReferenceListDriver & improvement of Draw Get commands.

Replace tabs with spaces in newly added lines.

Test cases for issue CR25394
This commit is contained in:
msv
2015-04-09 16:34:06 +03:00
committed by bugmaster
parent 138ac5300a
commit d585e74e51
24 changed files with 838 additions and 223 deletions

View File

@@ -48,6 +48,8 @@ Standard_Boolean BinMDataStd_RealListDriver::Paste(const BinObjMgt_Persistent&
Standard_Integer aIndex, aFirstInd, aLastInd;
if (! (theSource >> aFirstInd >> aLastInd))
return Standard_False;
if(aLastInd == 0) return Standard_True;
const Standard_Integer aLength = aLastInd - aFirstInd + 1;
if (aLength <= 0)
return Standard_False;
@@ -55,7 +57,7 @@ Standard_Boolean BinMDataStd_RealListDriver::Paste(const BinObjMgt_Persistent&
TColStd_Array1OfReal aTargetArray(aFirstInd, aLastInd);
theSource.GetRealArray (&aTargetArray(aFirstInd), aLength);
Handle(TDataStd_RealList) anAtt = Handle(TDataStd_RealList)::DownCast(theTarget);
const Handle(TDataStd_RealList) anAtt = Handle(TDataStd_RealList)::DownCast(theTarget);
for (aIndex = aFirstInd; aIndex <= aLastInd; aIndex++)
{
anAtt->Append(aTargetArray.Value(aIndex));
@@ -71,13 +73,14 @@ void BinMDataStd_RealListDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& ) const
{
Handle(TDataStd_RealList) anAtt = Handle(TDataStd_RealList)::DownCast(theSource);
const Standard_Integer aFirstInd = 1;
const Standard_Integer aLastInd = anAtt->Extent();
const Handle(TDataStd_RealList) anAtt = Handle(TDataStd_RealList)::DownCast(theSource);
const Standard_Integer aFirstInd = (anAtt->Extent()> 0) ? 1 : 0;
const Standard_Integer aLastInd(anAtt->Extent());
const Standard_Integer aLength = aLastInd - aFirstInd + 1;
if (aLength <= 0)
return;
theTarget << aFirstInd << aLastInd;
if(aLastInd == 0) return;
TColStd_Array1OfReal aSourceArray(aFirstInd, aLastInd);
if (aLastInd >= 1)
{