From 0ae47af79ddd643cc2affdcef7f9b0dedabba5d6 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 19 Dec 2016 18:59:37 +0300 Subject: [PATCH] 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. --- src/ModelAPI/ModelAPI_ResultPart.cpp | 6 ------ src/ModelAPI/ModelAPI_ResultPart.h | 3 --- src/ModelAPI/ModelAPI_Tools.cpp | 4 +++- 3 files changed, 3 insertions(+), 10 deletions(-) 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()) { -- 2.39.2