]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx
#3144 creaMaracasVisu Bug New Normal - changeWx28to30
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pPlotterWindow.cxx
index 5115e2d33b47c2dbf48f7e470f94913558877108..ea0be8fe85c003f009ff38ad7860058f22605576 100644 (file)
@@ -1740,12 +1740,20 @@ void pPlotterWindow :: OnGuideLines (wxCommandEvent   &event)
 */
 pGraphicalFunction* pPlotterWindow::getFunction(int index)
 {
-       wxNode* node=functions.Item(index);
-       if(node==NULL){
+       wxNode* node=NULL;
+       if (functions.size()>index)
+       {
+               node=functions.Item(index);
+       } // if
+
+       if(node==NULL)
+       {
                return NULL;
-       }
+       } // if node
        return (pGraphicalFunction*)node->GetData();
 }
+
+
 /*
          move the functions that the user wants to move
          and that were set in functionsToMove
@@ -1755,9 +1763,7 @@ pGraphicalFunction* pPlotterWindow::getFunction(int index)
          @param porcentageMaxX:the percentage that the maxShowed
          of the functions have to be move
                0<=porcentageMaxX<=1
-
        */
-
 void pPlotterWindow::moveFunctions( float porcentageMinX,float porcentageMaxX)
        {
                //Adding the actual function