lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] small MvcController::UponChildFocus() optimization/simplification


From: Vaclav Slavik
Subject: [lmi] small MvcController::UponChildFocus() optimization/simplification
Date: Thu, 01 Jan 2009 00:15:40 +0100

Hi,

below is patch that changes UponChildFocus()'s test for cancel button to
be done in a cleaner way -- there's no need to do it in O(#children)
when a trivial O(1) check accomplishes the same thing (as usual, unless
I am missing something). The two versions are identical if there's only
one cancel button and this one is more correct in the unlikely case of
more cancel buttons.

Regards,
Vaclav


Index: mvc_controller.cpp
===================================================================
RCS file: /sources/lmi/lmi/mvc_controller.cpp,v
retrieving revision 1.24
diff -u -r1.24 mvc_controller.cpp
--- mvc_controller.cpp  27 Dec 2008 02:56:50 -0000      1.24
+++ mvc_controller.cpp  31 Dec 2008 23:09:57 -0000
@@ -648,7 +648,7 @@
         return;
         }
 
-    if(FindWindow(wxID_CANCEL) == new_focused_window)
+    if(wxID_CANCEL == new_focused_window->GetId())
         {
         return;
         }







reply via email to

[Prev in Thread] Current Thread [Next in Thread]