From c24b9476fa5f7bbb0db49df3899996b55edbb698 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek <7330332+a-wi@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:13:21 +0100 Subject: [PATCH] Use unordered_map to store action triggers in wxPropertyGrid Use standard container explicitly (instead of alias wxPGHashMAPI2I). --- include/wx/propgrid/propgrid.h | 2 +- src/propgrid/propgrid.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index ad3df90aef..ee7ea2c334 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1539,7 +1539,7 @@ protected: wxPGValidationInfo m_validationInfo; // Actions and keys that trigger them. - wxPGHashMapI2I m_actionTriggers; + std::unordered_map m_actionTriggers; // Appearance of currently active editor. wxPGCell m_editorAppearance; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 49dc0942f7..155a60c42c 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5507,7 +5507,7 @@ std::pair wxPropertyGrid::KeyEventToActions(const wxKeyEvent& event) c int hashMapKey = (keycode & 0xFFFF) | ((modifiers & 0xFFFF) << 16); - wxPGHashMapI2I::const_iterator it = m_actionTriggers.find(hashMapKey); + auto it = m_actionTriggers.find(hashMapKey); if ( it == m_actionTriggers.end() ) return std::make_pair(0, 0); @@ -5542,7 +5542,7 @@ void wxPropertyGrid::AddActionTrigger( int action, int keycode, int modifiers ) int hashMapKey = (keycode & 0xFFFF) | ((modifiers & 0xFFFF) << 16); - wxPGHashMapI2I::iterator it = m_actionTriggers.find(hashMapKey); + auto it = m_actionTriggers.find(hashMapKey); if ( it != m_actionTriggers.end() ) { @@ -5560,7 +5560,7 @@ void wxPropertyGrid::AddActionTrigger( int action, int keycode, int modifiers ) void wxPropertyGrid::ClearActionTriggers( int action ) { - wxPGHashMapI2I::iterator it = m_actionTriggers.begin(); + auto it = m_actionTriggers.begin(); while ( it != m_actionTriggers.end() ) { if ( it->second == action )