From: mpv Date: Mon, 19 Dec 2016 15:59:37 +0000 (+0300) Subject: Fix for the ability to duplicate part which was translated. X-Git-Tag: before_porting_8.2.0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0ae47af79ddd643cc2affdcef7f9b0dedabba5d6;p=modules%2Fshaper.git Fix for the ability to duplicate part which was translated. The problem was in not-disabling of translation feature when the original part was activated. --- diff --git a/src/ModelAPI/ModelAPI_ResultPart.cpp b/src/ModelAPI/ModelAPI_ResultPart.cpp index 3639c47b1..9790051d7 100644 --- a/src/ModelAPI/ModelAPI_ResultPart.cpp +++ b/src/ModelAPI/ModelAPI_ResultPart.cpp @@ -12,9 +12,3 @@ std::string ModelAPI_ResultPart::groupName() { return ModelAPI_ResultPart::group(); } - -bool ModelAPI_ResultPart::isConcealed() -{ - //return false; - return ModelAPI_Result::isConcealed(); // the way with different results is applied -} diff --git a/src/ModelAPI/ModelAPI_ResultPart.h b/src/ModelAPI/ModelAPI_ResultPart.h index 4345f303c..f86754e80 100644 --- a/src/ModelAPI/ModelAPI_ResultPart.h +++ b/src/ModelAPI/ModelAPI_ResultPart.h @@ -46,9 +46,6 @@ class ModelAPI_ResultPart : public ModelAPI_Result return RESULT_BODY_COLOR; } - // Part result can not be cencealed, even by the movement features - MODELAPI_EXPORT virtual bool isConcealed(); - /// Returns the part-document of this result virtual std::shared_ptr partDoc() = 0; diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index cc56c2a37..f6182527a 100755 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -224,7 +224,9 @@ FeaturePtr findPartFeature(const DocumentPtr& theMain, const DocumentPtr& theSub // to optimize and avoid of crash on partset document close // (don't touch the sub-document structure) if (theMain != theSub) { - for (int a = theMain->size(ModelAPI_Feature::group()) - 1; a >= 0; a--) { + // iteration from top to bottom to avoid finding the movement documents before the original + int aSize = theMain->size(ModelAPI_Feature::group()); + for (int a = 0; a < aSize; a++) { FeaturePtr aPartFeat = std::dynamic_pointer_cast( theMain->object(ModelAPI_Feature::group(), a)); if (aPartFeat.get()) {