]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/menu.cpp
Fixed premature exit of helpview sample and utility
[wxWidgets.git] / src / univ / menu.cpp
index 0a29b8ada51ce113d7327748f4ac20037845e72d..2d3fa88a55101453f890433e4a03cf8a24a7f44f 100644 (file)
@@ -347,7 +347,7 @@ void wxPopupMenuWindow::SetCurrentItem(wxMenuItemIter node)
 
 void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node)
 {
-    if ( !m_nodeCurrent || (node != m_nodeCurrent) )
+    if ( !m_nodeCurrent || !node || (node != m_nodeCurrent) )
     {
         wxMenuItemIter nodeOldCurrent = m_nodeCurrent;
 
@@ -988,7 +988,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
 
                     int idxAccel = item->GetAccelIndex();
                     if ( idxAccel != -1 &&
-                         wxTolower(item->GetLabel()[(size_t)idxAccel])
+                         (wxChar)wxTolower(item->GetLabel()[(size_t)idxAccel])
                             == chAccel )
                     {
                         // ok, found an item with this accel
@@ -2330,8 +2330,7 @@ int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
 
         int idxAccel = info.GetAccelIndex();
         if ( idxAccel != -1 &&
-             wxTolower(info.GetLabel()[(size_t)idxAccel])
-                == chAccel )
+             (wxChar)wxTolower(info.GetLabel()[(size_t)idxAccel]) == chAccel )
         {
             // ok, found an item with this accel
             if ( idxFound == -1 )