From 5e62d11396e77cb030ca3978a8172ffccf92bf75 Mon Sep 17 00:00:00 2001 From: Vitaly SMETANNIKOV Date: Wed, 11 Nov 2015 16:23:16 +0300 Subject: [PATCH] Fix for compilation errors on Linux --- src/Model/Model_Document.cpp | 2 +- src/XGUI/XGUI_Tools.cpp | 28 ++++++++++++++-------------- src/XGUI/XGUI_Tools.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index c6e15c7ef..07ae19b10 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -438,7 +438,7 @@ static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) { const TDF_AttributeDeltaList& anAttrs = aDelta->AttributeDeltas(); for (TDF_ListIteratorOfAttributeDeltaList anAttr(anAttrs); anAttr.More(); anAttr.Next()) { Handle(TDF_AttributeDelta)& anADelta = anAttr.Value(); - Handle(TDF_DeltaOnAddition)& anAddition = Handle(TDF_DeltaOnAddition)::DownCast(anADelta); + Handle(TDF_DeltaOnAddition) anAddition = Handle(TDF_DeltaOnAddition)::DownCast(anADelta); if (anAddition.IsNull()) { // if the attribute was added, transaction is not empty if (!anADelta->Label().IsNull() && !anADelta->Attribute().IsNull()) { Handle(TDF_Attribute) aCurrentAttr; diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index cd7248f45..ab9ef819f 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -155,20 +155,6 @@ void refsToFeatureInFeatureDocument(const ObjectPtr& theObject, std::set aRefFeatures; - refsToFeatureInFeatureDocument(theObject, aRefFeatures); - std::set::const_iterator anIt = aRefFeatures.begin(), - aLast = aRefFeatures.end(); - for (; anIt != aLast && !isSub; anIt++) { - isSub = isSubOfComposite(theObject, *anIt); - } - return isSub; -} - //************************************************************** bool isSubOfComposite(const ObjectPtr& theObject, const FeaturePtr& theFeature) { @@ -188,6 +174,20 @@ bool isSubOfComposite(const ObjectPtr& theObject, const FeaturePtr& theFeature) return isSub; } +//************************************************************** +bool isSubOfComposite(const ObjectPtr& theObject) +{ + bool isSub = false; + std::set aRefFeatures; + refsToFeatureInFeatureDocument(theObject, aRefFeatures); + std::set::const_iterator anIt = aRefFeatures.begin(), + aLast = aRefFeatures.end(); + for (; anIt != aLast && !isSub; anIt++) { + isSub = isSubOfComposite(theObject, *anIt); + } + return isSub; +} + //************************************************************** void refsToFeatureInAllDocuments(const ObjectPtr& theSourceObject, const ObjectPtr& theObject, std::set& theDirectRefFeatures, diff --git a/src/XGUI/XGUI_Tools.h b/src/XGUI/XGUI_Tools.h index 48ab0d57b..18f237a00 100644 --- a/src/XGUI/XGUI_Tools.h +++ b/src/XGUI/XGUI_Tools.h @@ -108,7 +108,7 @@ void XGUI_EXPORT refsToFeatureInFeatureDocument(const ObjectPtr& theObject, \param theFeature a candidate to be a composite feature \return a boolean value */ -bool XGUI_EXPORT isSubOfComposite(const ObjectPtr& theObject, const FeaturePtr& theFeature); +bool XGUI_EXPORT isSubOfComposite(const ObjectPtr& theObject); /*! Returns a container of references feature to the source object. The search happens in the object -- 2.39.2