]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/ogl/canvas.cpp
Fix unintialized pointer in wxCommandProcessor when
[wxWidgets.git] / contrib / src / ogl / canvas.cpp
index 55e87da514993c78f86a0bc8020b64b7e8654028..77fa05b67e98dadfabc58cc85a7c4e309881b85a 100644 (file)
@@ -24,7 +24,9 @@
 #include <wx/wx.h>
 #endif
 
-#include <wx/wxexpr.h>
+#if wxUSE_DEPRECATED
+#include <wx/deprecated/wxexpr.h>
+#endif
 
 #ifdef new
 #undef new
@@ -62,7 +64,7 @@ BEGIN_EVENT_TABLE(wxShapeCanvas, wxScrolledWindow)
     EVT_MOUSE_EVENTS(wxShapeCanvas::OnMouseEvent)
 END_EVENT_TABLE()
 
-wxChar* wxShapeCanvasNameStr = wxT("shapeCanvas");
+const wxChar* wxShapeCanvasNameStr = wxT("shapeCanvas");
 
 // Object canvas
 wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id,
@@ -397,10 +399,10 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
   //     the other objects
   // (b) to find the control points FIRST if they exist
 
-  wxNode *current = GetDiagram()->GetShapeList()->Last();
+  wxNode *current = GetDiagram()->GetShapeList()->GetLast();
   while (current)
   {
-    wxShape *object = (wxShape *)current->Data();
+    wxShape *object = (wxShape *)current->GetData();
 
     double dist;
     int temp_attachment;
@@ -430,13 +432,13 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
       }
     }
     if (current)
-      current = current->Previous();
+      current = current->GetPrevious();
   }
 
-  current = GetDiagram()->GetShapeList()->Last();
+  current = GetDiagram()->GetShapeList()->GetLast();
   while (current)
   {
-    wxShape *object = (wxShape *)current->Data();
+    wxShape *object = (wxShape *)current->GetData();
     double dist;
     int temp_attachment;
 
@@ -461,7 +463,7 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
       }
     }
     if (current)
-      current = current->Previous();
+      current = current->GetPrevious();
   }
 
   *attachment = nearest_attachment;