From 0b03bcbe132da7ec111f83a90463febd218d558e Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 13 Oct 2014 11:47:01 +0400 Subject: [PATCH] Avoid empty names (changes from MPV) --- src/Model/Model_ResultBody.cpp | 6 +++++- src/Model/Model_Session.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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(); } -- 2.39.2