Salome HOME
Merge branch 'SketchSolver_Linux' of newgeom:newgeom into SolveSpace
[modules/shaper.git] / src / Model / Model_Document.cpp
index a41e2c7fa6097698673377f3129caae234f8b011..266622522498c4edf7359632df35d05102a8a126 100644 (file)
@@ -20,6 +20,9 @@
 #include <TDataStd_Name.hxx>
 
 #include <climits>
+#ifndef WIN32
+#include <sys/stat.h>
+#endif
 
 #ifdef WIN32
 # define _separator_ '\\'
@@ -325,7 +328,8 @@ void Model_Document::addFeature(const boost::shared_ptr<ModelAPI_Feature> theFea
   TDF_Label anObjLab = aGroupLab.NewChild();
   TCollection_ExtendedString aName(theFeature->data()->getName().c_str());
   TDataStd_Name::Set(anObjLab, aName);
-  AddToRefArray(aGroupLab.FindChild(1), anObjLab); // reference to names is on the first sub
+  TDF_Label aGrLabChild = aGroupLab.FindChild(1);
+  AddToRefArray(aGrLabChild, anObjLab); // reference to names is on the first sub
 
   // event: feature is added
   static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
@@ -383,7 +387,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(
 int Model_Document::size(const string& theGroupID) 
 {
   Handle(TDataStd_ReferenceArray) aRefs;
-  if (groupLabel(FEATURES_GROUP).FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs))
+  if (groupLabel(theGroupID).FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs))
     return aRefs->Length();
   // group is not found
   return 0;