From ade1afec98d9bbdfe767ccccbe2c250af882b0aa Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 17 Sep 2015 12:08:11 +0300 Subject: [PATCH] Fix for the issue #991 --- src/Model/Model_ResultPart.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 7edb9b2e5..bb12b1075 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -110,9 +110,9 @@ bool Model_ResultPart::setDisabled(std::shared_ptr theThis, if (!myTrsf.get()) { // disable of base result part DocumentPtr aDoc = Model_ResultPart::partDoc(); if (aDoc.get() && aDoc->isOpened()) { + std::shared_ptr anIntDoc = std::dynamic_pointer_cast(aDoc); // make the current feature the last in any case: to update shapes defore deactivation too - FeaturePtr aLastFeature = std::dynamic_pointer_cast(aDoc->object( - ModelAPI_Feature::group(), aDoc->size(ModelAPI_Feature::group()) - 1)); + FeaturePtr aLastFeature = anIntDoc->lastFeature(); aDoc->setCurrentFeature(aLastFeature, false); if (theFlag) { // disable, so make all features disabled too // update the shape just before the deactivation: it will be used outside of part -- 2.39.2