Salome HOME
Change name of standalone application from OpenParts to CADBuilder
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index 4a85e1c0c999c490931c85b0df8b4f7fb4e56018..b528344ce493df558b99541aabaa011b1cdc12fd 100644 (file)
@@ -40,6 +40,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Expression.h>
+#include <ModelAPI_ResultField.h>
 #include <Events_Loop.h>
 
 #include <ModelAPI_Data.h>
@@ -397,8 +398,9 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe
     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
     FolderPtr aFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(aObj);
     ResultParameterPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aResult);
+    FieldStepPtr aStep = std::dynamic_pointer_cast<ModelAPI_ResultField::ModelAPI_FieldStep>(aObj);
 
-    hasResult |= (aResult.get() != NULL);
+    hasResult |= ((aResult.get() != NULL) || (aStep.get() != NULL));
     hasFeature |= (aFeature.get() != NULL);
     hasFolder |= (aFolder.get() != NULL);
     hasParameter |= (aConstruction.get() != NULL);
@@ -800,7 +802,7 @@ QString wrapTextByWords(const QString& theValue, QWidget* theWidget,
   int n = aWords.count();
   QString aLine;
   for (int i = 0; i < n; i++) {
-    QString aLineExt = aLine + " " + aWords[i];
+    QString aLineExt =  i == 0 ? aWords[i] : aLine + " " + aWords[i];
     qreal anWidthNonExt = tfm.boundingRect(aLine).width();
     qreal anWidthExt = tfm.boundingRect(aLineExt).width();
     qreal aDeltaNonExt = fabs(anWidthNonExt-aGoldWidth);
@@ -992,6 +994,8 @@ bool askToDelete(const std::set<FeaturePtr> theFeatures,
   aLast = theReferencesToDelete.end();
   for (; anIt != aLast; anIt++) {
     FeaturePtr aFeature = *anIt;
+    if (aFeature->getKind() == "RemoveResults")
+      continue; // skip the remove results feature mentioning: result will be removed anyway
     if (isFeatureOfResult(aFeature, ModelAPI_ResultPart::group()))
       aPartFeatureNames.append(aFeature->name().c_str());
     else
@@ -1126,7 +1130,7 @@ void setPointBallHighlighting(AIS_Shape* theAIS)
       aFile = std::string(anEnv) +
         FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
     } else {
-      anEnv = getenv("OPENPARTS_ROOT_DIR");
+      anEnv = getenv("CADBUILDER_ROOT_DIR");
       if (anEnv)
         aFile = std::string(anEnv) + FSEP + "resources";
     }