From 614fbbad61f7e1fc11a2c2c2bbb1029cba672282 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sat, 27 Sep 2008 15:29:05 +0000 Subject: [PATCH] wxPropertyGrid::RegisterEditorClass() now CHECK_MSG()s for duplicate editor names git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 9a9417162f..317e4c0eb4 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5537,6 +5537,14 @@ wxPGEditor* wxPropertyGrid::RegisterEditorClass( wxPGEditor* editorClass, RegisterDefaultEditors(); wxString name = editorClass->GetName(); + + // Existing editor under this name? + wxPGHashMapS2P::iterator vt_it = wxPGGlobalVars->m_mapEditorClasses.find(name); + + wxCHECK_MSG( vt_it == wxPGGlobalVars->m_mapEditorClasses.end(), + (wxPGEditor*) vt_it->second, + "Editor with given name was already registered" ); + wxPGGlobalVars->m_mapEditorClasses[name] = (void*)editorClass; return editorClass; -- 2.47.2