From cbc4faa980e1a6c969b1e2a9e33b0f8d01ddf924 Mon Sep 17 00:00:00 2001 From: szy Date: Mon, 19 Mar 2018 18:43:04 +0300 Subject: [PATCH] 0029574: Protection of attributes retrieval against zero ID in Ocaf XML. //Impacts attributes supporting user defined IDs. --- .../XmlMDataStd_BooleanArrayDriver.cxx | 45 ++++++++++--------- .../XmlMDataStd_BooleanListDriver.cxx | 34 +++++++------- .../XmlMDataStd_ByteArrayDriver.cxx | 25 ++++++----- .../XmlMDataStd_ExtStringArrayDriver.cxx | 20 ++++----- .../XmlMDataStd_ExtStringListDriver.cxx | 22 ++++----- .../XmlMDataStd_IntegerArrayDriver.cxx | 32 +++++++------ src/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx | 4 +- .../XmlMDataStd_IntegerListDriver.cxx | 34 +++++++------- src/XmlMDataStd/XmlMDataStd_NameDriver.cxx | 6 +-- .../XmlMDataStd_ReferenceArrayDriver.cxx | 20 ++++----- .../XmlMDataStd_ReferenceListDriver.cxx | 18 ++++---- 11 files changed, 130 insertions(+), 130 deletions(-) diff --git a/src/XmlMDataStd/XmlMDataStd_BooleanArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_BooleanArrayDriver.cxx index c2cd22d8a9..51e2788951 100644 --- a/src/XmlMDataStd/XmlMDataStd_BooleanArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_BooleanArrayDriver.cxx @@ -93,28 +93,6 @@ Standard_Boolean XmlMDataStd_BooleanArrayDriver::Paste(const XmlObjMgt_Persisten } Handle(TDataStd_BooleanArray) aBooleanArray = Handle(TDataStd_BooleanArray)::DownCast(theTarget); - aBooleanArray->Init(aFirstInd, aLastInd); - Standard_Integer length = aLastInd - aFirstInd + 1; - Handle(TColStd_HArray1OfByte) hArr = new TColStd_HArray1OfByte(0, length >> 3); - TColStd_Array1OfByte& arr = hArr->ChangeArray1(); - - Standard_Integer i = 0, upper = arr.Upper(); - Standard_CString aValueStr = Standard_CString(XmlObjMgt::GetStringValue(anElement).GetString()); - for (; i <= upper; i++) - { - if (!XmlObjMgt::GetInteger(aValueStr, aValue)) - { - TCollection_ExtendedString aMessageString = - TCollection_ExtendedString("Cannot retrieve integer member" - " for BooleanArray attribute as \"") - + aValueStr + "\""; - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; - } - arr.SetValue(i, (Standard_Byte) aValue); - } - aBooleanArray->SetInternalArray(hArr); - // attribute id Standard_GUID aGUID; XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); @@ -123,6 +101,29 @@ Standard_Boolean XmlMDataStd_BooleanArrayDriver::Paste(const XmlObjMgt_Persisten else aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case aBooleanArray->SetID(aGUID); + + aBooleanArray->Init(aFirstInd, aLastInd); + Standard_Integer length = aLastInd - aFirstInd + 1; + Handle(TColStd_HArray1OfByte) hArr = new TColStd_HArray1OfByte(0, length >> 3); + TColStd_Array1OfByte& arr = hArr->ChangeArray1(); + Standard_Integer i = 0, upper = arr.Upper(); + Standard_CString aValueStr = Standard_CString(XmlObjMgt::GetStringValue(anElement).GetString()); + + for (; i <= upper; i++) + { + if (!XmlObjMgt::GetInteger(aValueStr, aValue)) + { + TCollection_ExtendedString aMessageString = + TCollection_ExtendedString("Cannot retrieve integer member" + " for BooleanArray attribute as \"") + + aValueStr + "\""; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; + } + arr.SetValue(i, (Standard_Byte) aValue); + } + aBooleanArray->SetInternalArray(hArr); + return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx b/src/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx index c4c22dacc0..cbcbd163f8 100644 --- a/src/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_BooleanListDriver.cxx @@ -85,19 +85,29 @@ Standard_Boolean XmlMDataStd_BooleanListDriver::Paste(const XmlObjMgt_Persistent } const Handle(TDataStd_BooleanList) aBooleanList = Handle(TDataStd_BooleanList)::DownCast(theTarget); + + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_BooleanList::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + + aBooleanList->SetID(aGUID); + if(aLastInd == 0) aFirstInd = 0; if (aFirstInd == aLastInd && aLastInd > 0) { - Standard_Integer anInteger; - if (!XmlObjMgt::GetStringValue(anElement).GetInteger(anInteger)) + if (!XmlObjMgt::GetStringValue(anElement).GetInteger(aValue)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve integer member" " for BooleanList attribute as \""); - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } - aBooleanList->Append(anInteger ? Standard_True : Standard_False); + aBooleanList->Append(aValue ? Standard_True : Standard_False); } else if(aLastInd >= 1) { @@ -110,23 +120,13 @@ Standard_Boolean XmlMDataStd_BooleanListDriver::Paste(const XmlObjMgt_Persistent TCollection_ExtendedString("Cannot retrieve integer member" " for BooleanList attribute as \"") + aValueStr + "\""; - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } aBooleanList->Append(aValue ? Standard_True : Standard_False); } } - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_BooleanList::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - aBooleanList->SetID(aGUID); - return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx index 71eb2447dc..3423e9afb2 100644 --- a/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ByteArrayDriver.cxx @@ -96,6 +96,17 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& Handle(TDataStd_ByteArray) aByteArray = Handle(TDataStd_ByteArray)::DownCast(theTarget); + + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_ByteArray::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + + aByteArray->SetID(aGUID); + Handle(TColStd_HArray1OfByte) hArr = new TColStd_HArray1OfByte(aFirstInd, aLastInd); TColStd_Array1OfByte& arr = hArr->ChangeArray1(); @@ -109,8 +120,8 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& TCollection_ExtendedString("Cannot retrieve integer member" " for ByteArray attribute as \"") + aValueStr + "\""; - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } arr.SetValue(i, (Standard_Byte) aValue); } @@ -138,16 +149,6 @@ Standard_Boolean XmlMDataStd_ByteArrayDriver::Paste(const XmlObjMgt_Persistent& #endif aByteArray->SetDelta(aDelta); - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_ByteArray::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - aByteArray->SetID(aGUID); - return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx index d4f93aeed7..e66d1981c2 100644 --- a/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ExtStringArrayDriver.cxx @@ -115,6 +115,16 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste Handle(TDataStd_ExtStringArray)::DownCast(theTarget); aExtStringArray->Init(aFirstInd, aLastInd); + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_ExtStringArray::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + + aExtStringArray->SetID(aGUID); + // Read string values. if ( !separator.Length() && anElement.hasChildNodes() ) { @@ -205,16 +215,6 @@ Standard_Boolean XmlMDataStd_ExtStringArrayDriver::Paste #endif aExtStringArray->SetDelta(aDelta); - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_ExtStringArray::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - aExtStringArray->SetID(aGUID); - return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_ExtStringListDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ExtStringListDriver.cxx index 0489eb8322..c9685ad9a1 100644 --- a/src/XmlMDataStd/XmlMDataStd_ExtStringListDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ExtStringListDriver.cxx @@ -87,13 +87,22 @@ Standard_Boolean XmlMDataStd_ExtStringListDriver::Paste(const XmlObjMgt_Persiste } const Handle(TDataStd_ExtStringList) anExtStringList = Handle(TDataStd_ExtStringList)::DownCast(theTarget); + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_ExtStringList::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + + anExtStringList->SetID(aGUID); + if(aLastInd > 0) { if (!anElement.hasChildNodes()) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve a list of extended strings"); - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); } LDOM_Node aCurNode = anElement.getFirstChild(); @@ -110,15 +119,6 @@ Standard_Boolean XmlMDataStd_ExtStringListDriver::Paste(const XmlObjMgt_Persiste XmlObjMgt::GetExtendedString( *aCurElement, aValueStr ); anExtStringList->Append(aValueStr); } - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_ExtStringList::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - anExtStringList->SetID(aGUID); return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx index cad547b177..9c5cc69d5f 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntegerArrayDriver.cxx @@ -89,16 +89,24 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste Handle(TDataStd_IntegerArray)::DownCast(theTarget); anIntArray->Init(aFirstInd, aLastInd); + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_IntegerArray::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + anIntArray->SetID(aGUID); + if(aFirstInd == aLastInd) { - Standard_Integer anInteger; - if(!XmlObjMgt::GetStringValue(anElement).GetInteger( anInteger)) { + if(!XmlObjMgt::GetStringValue(anElement).GetInteger( aValue)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve integer member" " for IntegerArray attribute as \""); - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } - anIntArray->SetValue(aFirstInd, anInteger); + anIntArray->SetValue(aFirstInd, aValue); } else { @@ -113,8 +121,8 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste TCollection_ExtendedString("Cannot retrieve integer member" " for IntegerArray attribute as \"") + aValueStr + "\""; - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } anIntArray->SetValue(ind, aValue); } @@ -141,16 +149,6 @@ Standard_Boolean XmlMDataStd_IntegerArrayDriver::Paste #endif anIntArray->SetDelta(aDelta); - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_IntegerArray::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - anIntArray->SetID(aGUID); - return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx index 55a85b6ec0..e5886d9381 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntegerDriver.cxx @@ -58,8 +58,8 @@ Standard_Boolean XmlMDataStd_IntegerDriver::Paste TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve Integer attribute from \"") + anIntStr + "\""; - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } Handle(TDataStd_Integer) anInt= Handle(TDataStd_Integer)::DownCast(theTarget); diff --git a/src/XmlMDataStd/XmlMDataStd_IntegerListDriver.cxx b/src/XmlMDataStd/XmlMDataStd_IntegerListDriver.cxx index fc1317300e..c0fb4b4ad3 100644 --- a/src/XmlMDataStd/XmlMDataStd_IntegerListDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_IntegerListDriver.cxx @@ -85,19 +85,29 @@ Standard_Boolean XmlMDataStd_IntegerListDriver::Paste(const XmlObjMgt_Persistent } const Handle(TDataStd_IntegerList) anIntList = Handle(TDataStd_IntegerList)::DownCast(theTarget); + + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_IntegerList::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + + anIntList->SetID(aGUID); + if(aLastInd == 0) aFirstInd = 0; if (aFirstInd == aLastInd && aLastInd > 0) { - Standard_Integer anInteger; - if (!XmlObjMgt::GetStringValue(anElement).GetInteger(anInteger)) + if (!XmlObjMgt::GetStringValue(anElement).GetInteger(aValue)) { TCollection_ExtendedString aMessageString = TCollection_ExtendedString("Cannot retrieve integer member" " for IntegerList attribute as \""); - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } - anIntList->Append(anInteger); + anIntList->Append(aValue); } else if(aLastInd >= 1) { @@ -110,23 +120,13 @@ Standard_Boolean XmlMDataStd_IntegerListDriver::Paste(const XmlObjMgt_Persistent TCollection_ExtendedString("Cannot retrieve integer member" " for IntegerList attribute as \"") + aValueStr + "\""; - myMessageDriver->Send (aMessageString, Message_Fail); - return Standard_False; + myMessageDriver->Send (aMessageString, Message_Warning); + aValue = 0; } anIntList->Append(aValue); } } - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_IntegerList::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - anIntList->SetID(aGUID); - return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_NameDriver.cxx b/src/XmlMDataStd/XmlMDataStd_NameDriver.cxx index a558391ec6..37649cb3a4 100644 --- a/src/XmlMDataStd/XmlMDataStd_NameDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_NameDriver.cxx @@ -53,11 +53,11 @@ Standard_Boolean XmlMDataStd_NameDriver::Paste const Handle(TDF_Attribute)& theTarget, XmlObjMgt_RRelocationTable& ) const { - if(!theTarget.IsNull()) { + if(!theTarget.IsNull()) { TCollection_ExtendedString aString; if (XmlObjMgt::GetExtendedString (theSource, aString)) { - Handle(TDataStd_Name)::DownCast(theTarget) -> Set (aString); + Handle(TDataStd_Name)::DownCast(theTarget) -> Set (aString); // attribute id Standard_GUID aGUID; const XmlObjMgt_Element& anElement = theSource; @@ -68,7 +68,7 @@ Standard_Boolean XmlMDataStd_NameDriver::Paste aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case Handle(TDataStd_Name)::DownCast(theTarget)->SetID(aGUID); - return Standard_True; + return Standard_True; } } myMessageDriver->Send("error retrieving ExtendedString for type TDataStd_Name", Message_Fail); diff --git a/src/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx index 0a84561a61..85b880f5ef 100644 --- a/src/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ReferenceArrayDriver.cxx @@ -89,6 +89,16 @@ Standard_Boolean XmlMDataStd_ReferenceArrayDriver::Paste(const XmlObjMgt_Persist Handle(TDataStd_ReferenceArray) aReferenceArray = Handle(TDataStd_ReferenceArray)::DownCast(theTarget); aReferenceArray->Init(aFirstInd, aLastInd); + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_ReferenceArray::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + + aReferenceArray->SetID(aGUID); + if (!anElement.hasChildNodes()) { TCollection_ExtendedString aMessageString = @@ -153,16 +163,6 @@ Standard_Boolean XmlMDataStd_ReferenceArrayDriver::Paste(const XmlObjMgt_Persist } aReferenceArray->SetValue(i, tLab); - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_ReferenceArray::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - aReferenceArray->SetID(aGUID); - return Standard_True; } diff --git a/src/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx b/src/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx index e6ffe530e5..b69e890cff 100644 --- a/src/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx +++ b/src/XmlMDataStd/XmlMDataStd_ReferenceListDriver.cxx @@ -88,6 +88,15 @@ Standard_Boolean XmlMDataStd_ReferenceListDriver::Paste(const XmlObjMgt_Persiste } const Handle(TDataStd_ReferenceList) aReferenceList = Handle(TDataStd_ReferenceList)::DownCast(theTarget); + // attribute id + Standard_GUID aGUID; + XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); + if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) + aGUID = TDataStd_ReferenceList::GetID(); //default case + else + aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case + aReferenceList->SetID(aGUID); + if(aLastInd > 0) { if (!anElement.hasChildNodes()) { @@ -151,15 +160,6 @@ Standard_Boolean XmlMDataStd_ReferenceListDriver::Paste(const XmlObjMgt_Persiste } aReferenceList->Append(tLab); } - // attribute id - Standard_GUID aGUID; - XmlObjMgt_DOMString aGUIDStr = anElement.getAttribute(::AttributeIDString()); - if (aGUIDStr.Type() == XmlObjMgt_DOMString::LDOM_NULL) - aGUID = TDataStd_ReferenceList::GetID(); //default case - else - aGUID = Standard_GUID(Standard_CString(aGUIDStr.GetString())); // user defined case - - aReferenceList->SetID(aGUID); return Standard_True; }