]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug: wxPGProperty::SetName() crashed if it was called before property was added...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 16 Aug 2009 15:17:50 +0000 (15:17 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 16 Aug 2009 15:17:50 +0000 (15:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/property.h
include/wx/propgrid/propgrid.h
src/propgrid/property.cpp

index b8a1581e5a0595b594f0f488d55d5a4ef7a93c95..49205999448d47fb1510d7d12caa8a86dd16a000 100644 (file)
@@ -1957,7 +1957,7 @@ public:
 
     void SetLabel( const wxString& label ) { m_label = label; }
 
-    inline void SetName( const wxString& newName );
+    void SetName( const wxString& newName );
 
     /**
         Changes what sort of parent this property is for its children.
index d9744d8173d21dc8810478896384c90f6b010922..974fd034cd2c15c20c18ebd1a5e84651808f6236 100644 (file)
@@ -1914,11 +1914,6 @@ inline void wxPGProperty::SetEditor( const wxString& editorName )
     m_customEditor = wxPropertyGridInterface::GetEditorByName(editorName);
 }
 
-inline void wxPGProperty::SetName( const wxString& newName )
-{
-    GetGrid()->SetPropertyName(this, newName);
-}
-
 inline bool wxPGProperty::Hide( bool hide, int flags )
 {
     return GetGrid()->HideProperty(this, hide, flags);
index bbd56c2a03132d0aef6edd890173cee76f56108d..4f38e08d6bb5d6d7d877cda7bae3d2f482bd23eb 100644 (file)
@@ -613,6 +613,15 @@ bool wxPGProperty::IsSomeParent( wxPGProperty* candidate ) const
     return false;
 }
 
+void wxPGProperty::SetName( const wxString& newName )
+{
+    wxPropertyGrid* pg = GetGrid();
+
+    if ( pg )
+        pg->SetPropertyName(this, newName);
+    else
+        DoSetName(newName);
+}
 
 wxString wxPGProperty::GetName() const
 {