Salome HOME
Issue #1837: make all files with UNIX end lines
[modules/shaper.git] / src / Model / Model_AttributeReference.cpp
index b4d5acbeeead1cdd1684f34133d94ae7c756b29b..b17b72f87ba72c863cff12990e57451445a20838 100644 (file)
@@ -104,9 +104,15 @@ bool Model_AttributeReference::isInitialized()
 
 Model_AttributeReference::Model_AttributeReference(TDF_Label& theLabel)
 {
-  myIsInitialized = theLabel.FindAttribute(TDF_Reference::GetID(), myRef) == Standard_True;
+  myLab = theLabel;
+  reinit();
+}
+
+void Model_AttributeReference::reinit()
+{
+  myIsInitialized = myLab.FindAttribute(TDF_Reference::GetID(), myRef) == Standard_True;
   if (!myIsInitialized) {
-    myRef = TDF_Reference::Set(theLabel, theLabel);  // not initialized references to itself
+    myRef = TDF_Reference::Set(myLab, myLab);  // not initialized references to itself
   } else {
     if (owner()) {
       std::shared_ptr<Model_Document> aDoc =