- myBusy = false;
-
- QStringList aListId = QStringList::split("-", theNewText, false);
- if (aListId.count() != 2)
- return;
-
- int i;
- bool allOk = true;
- const SMDS_MeshNode* a2Nodes[2];
- for (i = 0; i < aListId.count(); i++) {
- if(const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[ i ].toInt()))
- a2Nodes[ i ] = aNode;
- else
- allOk = false;
- }
-
- // find a triangle and an edge nb
- const SMDS_MeshElement* tria[2];
- allOk &= a2Nodes[0] != a2Nodes[1] && findTriangles(a2Nodes[0],a2Nodes[1],tria[0],tria[1]);
- myBusy = true; // block onSelectionDone()
- if(allOk)
+
+ int id1, id2;
+ if ( !getNodeIds(myEdge->text(), id1, id2) )
+ return;
+
+ const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 );
+ const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 );
+
+ if ( !aNode1 || !aNode2 || aNode1 == aNode2 )
+ return;
+
+ // find a triangle and an edge index
+ const SMDS_MeshElement* tria1;
+ const SMDS_MeshElement* tria2;
+
+ if ( findTriangles(aNode1,aNode2,tria1,tria2) )