]> git.saurik.com Git - wxWidgets.git/commitdiff
wxPropertyGrid::RegisterEditorClass() now CHECK_MSG()s for duplicate editor names
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 27 Sep 2008 15:29:05 +0000 (15:29 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 27 Sep 2008 15:29:05 +0000 (15:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/propgrid.cpp

index 9a9417162f7938df550238c73f6a47574cdf90d3..317e4c0eb41d062700c40869147cb22b00576f48 100644 (file)
@@ -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;