]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
Update from Brian.
[wxWidgets.git] / src / propgrid / property.cpp
index 262d4648c26341ad56453be9d4cfb078337c968f..2fc310ebdd55706605574d6dc2d183a0b875cb68 100644 (file)
     #include "wx/panel.h"
     #include "wx/dc.h"
     #include "wx/dcmemory.h"
-    #include "wx/button.h"
     #include "wx/pen.h"
     #include "wx/brush.h"
-    #include "wx/cursor.h"
-    #include "wx/dialog.h"
     #include "wx/settings.h"
-    #include "wx/msgdlg.h"
-    #include "wx/choice.h"
-    #include "wx/stattext.h"
-    #include "wx/scrolwin.h"
-    #include "wx/dirdlg.h"
-    #include "wx/layout.h"
-    #include "wx/sizer.h"
-    #include "wx/textdlg.h"
-    #include "wx/filedlg.h"
-    #include "wx/statusbr.h"
     #include "wx/intl.h"
-    #include "wx/frame.h"
 #endif
 
 #include <wx/propgrid/propgrid.h>
 
-#include <typeinfo>
-
 
 #define PWC_CHILD_SUMMARY_LIMIT         16 // Maximum number of children summarized in a parent property's
                                            // value field.
@@ -1969,7 +1953,7 @@ void wxPGProperty::PrepareSubProperties()
 
             depth--;
 
-            i = nparent->GetArrIndex() + 1;
+            i = nparent->GetIndexInParent() + 1;
             nparent = nparent->GetParent();
         }
     }
@@ -2109,12 +2093,23 @@ void wxPGAttributeStorage::Set( const wxString& name, const wxVariant& value )
     // Free old, if any
     wxPGHashMapS2P::iterator it = m_map.find(name);
     if ( it != m_map.end() )
+    {
         ((wxVariantData*)it->second)->DecRef();
 
+        if ( !data )
+        {
+            // If Null variant, just remove from set
+            m_map.erase(it);
+            return;
+        }
+    }
+
     if ( data )
+    {
         data->IncRef();
 
-    m_map[name] = data;
+        m_map[name] = data;
+    }
 }
 
 #endif  // wxUSE_PROPGRID