#include <BinMDataStd_ReferenceListDriver.hxx>
+#include <BinMDataStd.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <CDM_MessageDriver.hxx>
#include <Standard_Type.hxx>
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMDataStd_ReferenceListDriver::Paste(const BinObjMgt_Persistent& theSource,
- const Handle(TDF_Attribute)& theTarget,
- BinObjMgt_RRelocationTable& ) const
+ const Handle(TDF_Attribute)& theTarget,
+ BinObjMgt_RRelocationTable& ) const
{
Standard_Integer 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;
const Handle(TDataStd_ReferenceList) anAtt = Handle(TDataStd_ReferenceList)::DownCast(theTarget);
- for (Standard_Integer i = aFirstInd; i <= aLastInd; i++)
- {
- TCollection_AsciiString entry;
- if ( !(theSource >> entry) )
+ if(aLastInd > 0) {
+
+ const Standard_Integer aLength = aLastInd - aFirstInd + 1;
+ if (aLength <= 0)
return Standard_False;
- TDF_Label L;
- TDF_Tool::Label(anAtt->Label().Data(), entry, L, Standard_True);
- if (!L.IsNull())
- anAtt->Append(L);
+ for (Standard_Integer i = aFirstInd; i <= aLastInd; i++)
+ {
+ TCollection_AsciiString entry;
+ if ( !(theSource >> entry) )
+ return Standard_False;
+ TDF_Label L;
+ TDF_Tool::Label(anAtt->Label().Data(), entry, L, Standard_True);
+ if (!L.IsNull())
+ anAtt->Append(L);
+ }
}
+ BinMDataStd::SetAttributeID(theSource, anAtt);
return Standard_True;
}
//purpose : transient -> persistent (store)
//=======================================================================
void BinMDataStd_ReferenceListDriver::Paste(const Handle(TDF_Attribute)& theSource,
- BinObjMgt_Persistent& theTarget,
- BinObjMgt_SRelocationTable& ) const
+ BinObjMgt_Persistent& theTarget,
+ BinObjMgt_SRelocationTable& ) const
{
const Handle(TDataStd_ReferenceList) anAtt = Handle(TDataStd_ReferenceList)::DownCast(theSource);
if (anAtt.IsNull())
theTarget << entry;
}
}
+
+ // process user defined guid
+ if(anAtt->ID() != TDataStd_ReferenceList::GetID())
+ theTarget << anAtt->ID();
}