]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fix for bugs:
authorsan <san@opencascade.com>
Mon, 18 Jul 2005 12:02:11 +0000 (12:02 +0000)
committersan <san@opencascade.com>
Mon, 18 Jul 2005 12:02:11 +0000 (12:02 +0000)
1) PAL9510 (SIGSEGV appears after trying to add an empty InLine node:
            modifications in addInlineNode() function),
2) PAL9512 (Incorrect default view of the "Add Node" dlg:
            modifications in initialise() function).

src/SUPERVGUI/SUPERVGUI_Service.cxx

index b798d25c1dd0caac092afbd64e4728d16f3a3cb0..16d897e6fe0af8b90e172d4e3896550658fb41b9 100644 (file)
@@ -314,7 +314,7 @@ void SUPERVGUI_Service::initialise() {
        SALOME_ModuleCatalog::Service* Service = &(Interface->interfaceservicelist[k]);
        QListViewItem* myServiceItem = new QListViewItem(myInterfaceItem, (char*)Service->ServiceName);
        myServiceItem->setSelectable(true);
-       components->ensureItemVisible(myServiceItem);
+       //components->ensureItemVisible(myServiceItem);
        
        long nbPortsOut = Service->ServiceoutParameter.length();
        for (int m=0; m<nbPortsOut; m++) {
@@ -480,8 +480,9 @@ void SUPERVGUI_Service::addInlineNode() {
     switch (aSel) {
     case 0: // Computation
       {        
-       SUPERV_CNode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(), 
-                                                        (myScriptPane->getFunction()).in());
+       SUPERV_CNode aNode = 
+         aMain->getDataflow()->INode(myScriptPane->getFuncName().isEmpty() ? "" : myScriptPane->getFuncName().latin1(), 
+                                     (myScriptPane->getFunction()).in());
        if (CORBA::is_nil(aNode)) {
          QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));       
          return;
@@ -494,9 +495,10 @@ void SUPERVGUI_Service::addInlineNode() {
     case 1: // Switch
       {
        SUPERV_INode aEndNode;
-       SUPERV_CNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(),
-                                                             (myScriptPane->getFunction()).in(),
-                                                             aEndNode);
+       SUPERV_CNode aStartNode = 
+         aMain->getDataflow()->SNode(myScriptPane->getFuncName().isEmpty() ? "" : myScriptPane->getFuncName().latin1(),
+                                     (myScriptPane->getFunction()).in(),
+                                     aEndNode);
        if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
          QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));       
          return;
@@ -508,10 +510,14 @@ void SUPERVGUI_Service::addInlineNode() {
     case 2: // Loop
       {
        SUPERV_INode aEndNode;
-       SUPERV_CNode aStartNode = aMain->getDataflow()->LNode(myInitPane->getFuncName().latin1(), (myInitPane->getFunction()).in(),
-                                                             myMorePane->getFuncName().latin1(), (myMorePane->getFunction()).in(),
-                                                             myNextPane->getFuncName().latin1(), (myNextPane->getFunction()).in(),
-                                                             aEndNode);
+       SUPERV_CNode aStartNode = 
+         aMain->getDataflow()->LNode(myInitPane->getFuncName().isEmpty() ? "" : myInitPane->getFuncName().latin1(), 
+                                     (myInitPane->getFunction()).in(),
+                                     myMorePane->getFuncName().isEmpty() ? "" : myMorePane->getFuncName().latin1(), 
+                                     (myMorePane->getFunction()).in(),
+                                     myNextPane->getFuncName().isEmpty() ? "" : myNextPane->getFuncName().latin1(), 
+                                     (myNextPane->getFunction()).in(),
+                                     aEndNode);
        if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
          QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));       
          return;