From: mpv Date: Fri, 3 Jul 2015 08:58:58 +0000 (+0300) Subject: Fix for the issue #712 X-Git-Tag: V_1.3.0~116 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66d43d6617904551ac0de5bb7bf635f8271141eb;p=modules%2Fshaper.git Fix for the issue #712 --- diff --git a/src/PartSetPlugin/PartSetPlugin_Part.cpp b/src/PartSetPlugin/PartSetPlugin_Part.cpp index 3ef0eb192..f8b348a37 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Part.cpp @@ -55,7 +55,7 @@ std::shared_ptr PartSetPlugin_Part::addFeature(std::string the ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { DocumentPtr aDoc = aResult->partDoc(); - if (aDoc.get()) + if (aDoc.get() && aDoc->isOpened()) return aDoc->addFeature(theID); } return FeaturePtr(); @@ -66,7 +66,7 @@ int PartSetPlugin_Part::numberOfSubs() const ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { DocumentPtr aDoc = aResult->partDoc(); - if (aDoc.get()) + if (aDoc.get() && aDoc->isOpened()) return aDoc->numInternalFeatures(); } return 0; @@ -77,7 +77,7 @@ std::shared_ptr PartSetPlugin_Part::subFeature(const int theIn ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { DocumentPtr aDoc = aResult->partDoc(); - if (aDoc.get()) { + if (aDoc.get() && aDoc->isOpened()) { return aDoc->internalFeature(theIndex); } } @@ -89,7 +89,7 @@ int PartSetPlugin_Part::subFeatureId(const int theIndex) const ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { DocumentPtr aDoc = aResult->partDoc(); - if (aDoc.get()) { + if (aDoc.get() && aDoc->isOpened()) { return aDoc->object(ModelAPI_Feature::group(), theIndex)->data()->featureId(); } } @@ -111,7 +111,7 @@ void PartSetPlugin_Part::removeFeature(std::shared_ptr theFeat ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { DocumentPtr aDoc = aResult->partDoc(); - if (aDoc.get()) + if (aDoc.get() && aDoc->isOpened()) aDoc->removeFeature(theFeature); } }