diff -r 44897b1ba4e2 -r 15b51d278bf0 gui/graph_displayer_canvas-event.cc --- a/gui/graph_displayer_canvas-event.cc Wed Jul 27 11:19:35 2005 +0000 +++ b/gui/graph_displayer_canvas-event.cc Wed Jul 27 11:35:13 2005 +0000 @@ -854,29 +854,46 @@ } -void GraphDisplayerCanvas::addNewEdgeMap(double default_value, std::string mapname) +int GraphDisplayerCanvas::addNewEdgeMap(double default_value, std::string mapname) { //create the new map Graph::EdgeMap * emptr=new Graph::EdgeMap (g,default_value); - mapstorage.addEdgeMap(mapname,emptr); + + //if addition was not successful addEdgeMap returns one. + //cause can be that there is already a map named like the new one + if(mapstorage.addEdgeMap(mapname,emptr)) + { + return 1; + } + //add it to the list of the displayable maps mapwin->registerNewEdgeMap(mapname); //display it changeEdgeText(mapname); + + return 0; } -void GraphDisplayerCanvas::addNewNodeMap(double default_value, std::string mapname) +int GraphDisplayerCanvas::addNewNodeMap(double default_value, std::string mapname) { //create the new map Graph::NodeMap * emptr=new Graph::NodeMap (g,default_value); - mapstorage.addNodeMap(mapname,emptr); + + //if addition was not successful addNodeMap returns one. + //cause can be that there is already a map named like the new one + if(mapstorage.addNodeMap(mapname,emptr)) + { + return 1; + } //add it to the list of the displayable maps mapwin->registerNewNodeMap(mapname); //display it changeNodeText(mapname); + + return 0; }