]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/ogl/ogledit/view.cpp
Source cleaning.
[wxWidgets.git] / contrib / samples / ogl / ogledit / view.cpp
index 8e26ab5f6ee661246a4eef8757ac56f9a8ac4bfe..1942b2c8207042193bb566de4fe09b08f2858418 100644 (file)
@@ -127,7 +127,7 @@ void DiagramView::OnDraw(wxDC *dc)
   if (diagram_p->GetShapeList())
   {
     /* wxCursor *old_cursor = NULL; */
-    wxNode *current = diagram_p->GetShapeList()->GetFirst();
+    wxObjectList::compatibility_iterator current = diagram_p->GetShapeList()->GetFirst();
 
     while (current) // Loop through the entire list of shapes
     {
@@ -176,19 +176,17 @@ bool DiagramView::OnClose(bool WXUNUSED(deleteWindow))
 wxShape *DiagramView::FindSelectedShape(void)
 {
   DiagramDocument *doc = (DiagramDocument *)GetDocument();
-  wxShape *theShape = NULL;
-  wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
+  wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
   while (node)
   {
     wxShape *eachShape = (wxShape *)node->GetData();
     if ((eachShape->GetParent() == NULL) && eachShape->Selected())
     {
-      theShape = eachShape;
-      node = NULL;
+      return eachShape;
     }
     else node = node->GetNext();
   }
-  return theShape;
+  return NULL;
 }
 
 void DiagramView::OnCut(wxCommandEvent& WXUNUSED(event))