Salome HOME
Fix for bug PAL12236 : SIGSEGV during init function definition of LoopNode.
authormkr <mkr@opencascade.com>
Fri, 21 Apr 2006 11:43:42 +0000 (11:43 +0000)
committermkr <mkr@opencascade.com>
Fri, 21 Apr 2006 11:43:42 +0000 (11:43 +0000)
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_Service.h
src/SUPERVGUI/SUPERV_msg_en.po

index 3f495403c6a388fdea00d22ab4cc105952d86454..a6bb0fa65b6abd018d19f324b00631ac789b22d9 100644 (file)
@@ -958,6 +958,7 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop )
   resize( 500, 250 );
   QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 4);
   int a,b; // dummies for PythonEditPane, not used, since library = false and myX, myY are not used in PythonEditPane
+  myIsLoop = isLoop; // mkr : PAL12236
   if (isLoop) {
     QTabWidget* aLoopTabPane = new QTabWidget(this);
     myInitPane = new SUPERVGUI_PythonEditPane( this, false, a, b ); // library == false, since no creation of a node is needed here
@@ -998,7 +999,12 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop )
 //                  will call with null python function name
 void SUPERVGUI_EditPythonDlg::clickOnOk()
 {
-  if ( getFuncName().isEmpty() )
+  // mkr : PAL12236
+  bool hasEmptyName = myIsLoop ? 
+    ( getInitFuncName().isEmpty() || getMoreFuncName().isEmpty() || getNextFuncName().isEmpty() ) :
+    getFuncName().isEmpty();
+
+  if ( hasEmptyName )
     QMessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(), tr( "ERROR" ), tr( "MSG_INCORRECT_INDENT" ) );
   else  
     accept();
@@ -1045,7 +1051,7 @@ void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var th
       aMain->addMacroNode( theNode );
     else if ( theNode->IsLoop() || theNode->IsSwitch() )
       aMain->addControlNode( theNode, SUPERV::CNode::_narrow( theEndNode ), true );
-    else
+    else 
       aMain->addComputeNode( theNode );
     aSupMod->nullifyInitialVF();
   }
index 3a466790dff17010eacc81404631a599e613a384..6b00762f99b3555fab773ef1945ca370930275b0 100644 (file)
@@ -53,7 +53,7 @@ public:
 
   SUPERV_Strings getFunction();
   void setFunction(SUPERV_Strings theStr);
-    
+
 public slots:
   // load all functions from an XML file into internal structures 
   void loadFile();
@@ -202,6 +202,8 @@ public slots:
   void clickOnOk();
 
 private:
+  bool  myIsLoop; // mkr : PAL12236
+
   SUPERVGUI_PythonEditPane* myEditPane;
   SUPERVGUI_PythonEditPane* myInitPane;
   SUPERVGUI_PythonEditPane* myMorePane;
index fc55fa1f2cff39d602234fc9a09523830c733d85..785d577da80332d3f7de13aacf55726de7dcc0bb 100644 (file)
@@ -974,7 +974,7 @@ msgid "TOOL_EXECUTION"
 msgstr "Execution"
 
 msgid "MSG_INCORRECT_INDENT"
-msgstr "Incorrect indent of the python function name (must be 0)!"
+msgstr "Incorrect indent of the python function name (must be 0) or \nthe name(s) of inline function(s) of this node is(are) empty !"
 
 msgid "MEN_SHOW_TOOLBAR"
 msgstr "Show toolbar"