From ce03308cda9f25081342e1d4f4bc804d7cb3a290 Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 21 Apr 2006 11:43:42 +0000 Subject: [PATCH] Fix for bug PAL12236 : SIGSEGV during init function definition of LoopNode. --- src/SUPERVGUI/SUPERVGUI_Service.cxx | 10 ++++++++-- src/SUPERVGUI/SUPERVGUI_Service.h | 4 +++- src/SUPERVGUI/SUPERV_msg_en.po | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_Service.cxx b/src/SUPERVGUI/SUPERVGUI_Service.cxx index 3f49540..a6bb0fa 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Service.cxx @@ -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(); } diff --git a/src/SUPERVGUI/SUPERVGUI_Service.h b/src/SUPERVGUI/SUPERVGUI_Service.h index 3a46679..6b00762 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.h +++ b/src/SUPERVGUI/SUPERVGUI_Service.h @@ -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; diff --git a/src/SUPERVGUI/SUPERV_msg_en.po b/src/SUPERVGUI/SUPERV_msg_en.po index fc55fa1..785d577 100644 --- a/src/SUPERVGUI/SUPERV_msg_en.po +++ b/src/SUPERVGUI/SUPERV_msg_en.po @@ -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" -- 2.30.2