From: vsv Date: Mon, 13 Oct 2014 07:47:01 +0000 (+0400) Subject: Avoid empty names (changes from MPV) X-Git-Tag: V_0.5~100 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b03bcbe132da7ec111f83a90463febd218d558e;p=modules%2Fshaper.git Avoid empty names (changes from MPV) --- diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index 0409a4cc2..f5c8cb223 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include Model_ResultBody::Model_ResultBody() @@ -20,7 +21,10 @@ void Model_ResultBody::store(const boost::shared_ptr& theShape) TDF_Label& aShapeLab = aData->shapeLab(); // remove the previous history clean(); - aShapeLab.ForgetAllAttributes(); + aShapeLab.ForgetAttribute(TNaming_NamedShape::GetID()); + for(TDF_ChildIterator anIter(aShapeLab); anIter.More(); anIter.Next()) { + anIter.Value().ForgetAllAttributes(); + } // store the new shape as primitive TNaming_Builder aBuilder(aShapeLab); if (!theShape) diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index e63c97cab..6a3cf53cc 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -99,7 +99,7 @@ FeaturePtr Model_Session::createFeature(string theFeatureID) std::pair& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind if (!aPlugin.second.empty() && aPlugin.second != activeDocument()->kind()) { Events_Error::send( - string("Feature '") + theFeatureID + "' can not be created in document '" + string("Feature '") + theFeatureID + "' can be created only in document '" + aPlugin.second + "' by the XML definition"); return FeaturePtr(); }