From: Sergey BELASH Date: Mon, 27 Oct 2014 14:22:57 +0000 (+0300) Subject: Make sources compilable under CentOS X-Git-Tag: V_0.5~69^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b0143e1a73ecab2db9756aa58bce9b894471ef53;p=modules%2Fshaper.git Make sources compilable under CentOS --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 3d351d413..fd363ae41 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -191,10 +192,12 @@ void Model_AttributeSelection::selectBody( aContext = aBody->shape()->impl(); else { ResultConstructionPtr aConstr = boost::dynamic_pointer_cast(myRef.value()); - if (aConstr) + if (aConstr) { aContext = aConstr->shape()->impl(); - else - throw std::invalid_argument("a result with shape is expected"); + } else { + Events_Error::send("A result with shape is expected"); + return; + } } aSel.Select(aNewShape, aContext); } diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 1de73631a..d7518ef60 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -46,8 +46,7 @@ #include #include -#include -#include +#include typedef QMap ShapeTypes; static ShapeTypes MyShapeTypes; diff --git a/src/PartSet/PartSet_OperationFeatureEditMulti.cpp b/src/PartSet/PartSet_OperationFeatureEditMulti.cpp index 9c9805860..7be21c613 100644 --- a/src/PartSet/PartSet_OperationFeatureEditMulti.cpp +++ b/src/PartSet/PartSet_OperationFeatureEditMulti.cpp @@ -24,13 +24,12 @@ #include +#include #ifdef _DEBUG #include #endif -#include - -using namespace std; +//using namespace std; PartSet_OperationFeatureEditMulti::PartSet_OperationFeatureEditMulti(const QString& theId, QObject* theParent, @@ -80,17 +79,16 @@ void PartSet_OperationFeatureEditMulti::initSelection( //} else myFeatures = theSelected; // add highlighted elements if they are not selected - std::list::const_iterator anIt; - for (anIt = theHighlighted.cbegin(); anIt != theHighlighted.cend(); ++anIt) { + std::list::const_iterator anIt = theHighlighted.cbegin(); + for ( ; anIt != theHighlighted.cend(); ++anIt) { if (!isContains(myFeatures, (*anIt))) myFeatures.push_back(*anIt); } // Remove current feature if it is in the list (it will be moved as main feature) - FeaturePtr aFea = feature(); - for (anIt = myFeatures.cbegin(); anIt != myFeatures.cend(); ++anIt) { - FeaturePtr aF = ModelAPI_Feature::feature((*anIt).object()); - if (ModelAPI_Feature::feature((*anIt).object()) == feature()) { - myFeatures.erase(anIt); + std::list::iterator anEraseIt = myFeatures.begin(); + for ( ; anEraseIt != myFeatures.end(); ++anEraseIt) { + if (ModelAPI_Feature::feature((*anEraseIt).object()) == feature()) { + myFeatures.erase(anEraseIt); break; } } diff --git a/src/PartSet/PartSet_OperationFeatureEditMulti.h b/src/PartSet/PartSet_OperationFeatureEditMulti.h index 44de5817b..1008f3deb 100644 --- a/src/PartSet/PartSet_OperationFeatureEditMulti.h +++ b/src/PartSet/PartSet_OperationFeatureEditMulti.h @@ -10,6 +10,8 @@ #include #include +#include + class QMouseEvent; /*! diff --git a/src/XGUI/XGUI_Preferences.cpp b/src/XGUI/XGUI_Preferences.cpp index 8f7b3059a..4d91ceb34 100644 --- a/src/XGUI/XGUI_Preferences.cpp +++ b/src/XGUI/XGUI_Preferences.cpp @@ -270,11 +270,12 @@ void XGUI_PreferencesDlg::modified(XGUI_Prefs& theModified) const void XGUI_PreferencesDlg::onDefault() { // reset main resources - QtxResourceMgr::WorkingMode aPrev = myPreferences->resourceMgr()->setWorkingMode - (QtxResourceMgr::IgnoreUserValues); +#ifdef WIN32 + QtxResourceMgr::WorkingMode aPrev = + myPreferences->resourceMgr()->setWorkingMode(QtxResourceMgr::IgnoreUserValues); myPreferences->retrieve(); myPreferences->resourceMgr()->setWorkingMode(aPrev); - +#endif // reset plugin's resources XGUI_Preferences::resetConfig(); XGUI_Preferences::updateResourcesByConfig();