X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36ca94a260b93ca35c5d5a09edfb8e104be0d694..1a6a83472414db1b9f3baa4eecac6d7bd4182c7c:/contrib/samples/ogl/ogledit/view.cpp?ds=sidebyside diff --git a/contrib/samples/ogl/ogledit/view.cpp b/contrib/samples/ogl/ogledit/view.cpp index f3655f821c..1942b2c820 100644 --- a/contrib/samples/ogl/ogledit/view.cpp +++ b/contrib/samples/ogl/ogledit/view.cpp @@ -176,19 +176,17 @@ bool DiagramView::OnClose(bool WXUNUSED(deleteWindow)) wxShape *DiagramView::FindSelectedShape(void) { DiagramDocument *doc = (DiagramDocument *)GetDocument(); - wxShape *theShape = NULL; 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))