]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
Patch wxGTK1 for recent changes in bmpbuttn
[wxWidgets.git] / src / propgrid / property.cpp
index 94c98b5f9da6e05347ad0868eea4f30cdbae5989..221ebb4f770e5833446f4e0bbc94caadd16f8d20 100644 (file)
@@ -1634,18 +1634,20 @@ long wxPGProperty::GetAttributeAsLong( const wxString& name, long defVal ) const
 {
     wxVariant variant = m_attributes.FindValue(name);
 
 {
     wxVariant variant = m_attributes.FindValue(name);
 
-    return wxPGVariantToInt(variant, defVal);
+    if ( variant.IsNull() )
+        return defVal;
+
+    return variant.GetLong();
 }
 
 double wxPGProperty::GetAttributeAsDouble( const wxString& name, double defVal ) const
 {
 }
 
 double wxPGProperty::GetAttributeAsDouble( const wxString& name, double defVal ) const
 {
-    double retVal;
     wxVariant variant = m_attributes.FindValue(name);
 
     wxVariant variant = m_attributes.FindValue(name);
 
-    if ( wxPGVariantToDouble(variant, &retVal) )
-        return retVal;
+    if ( variant.IsNull() )
+        return defVal;
 
 
-    return defVal;
+    return variant.GetDouble();
 }
 
 wxVariant wxPGProperty::GetAttributesAsList() const
 }
 
 wxVariant wxPGProperty::GetAttributesAsList() const
@@ -2163,7 +2165,10 @@ void wxPGProperty::AdaptListToValue( wxVariant& list, wxVariant* value ) const
             }
 
             if ( allChildrenSpecified )
             }
 
             if ( allChildrenSpecified )
-                ChildChanged(*value, i, childValue);
+            {
+                *value = ChildChanged(*value, i, childValue);
+            }
+
             n++;
             if ( n == (unsigned int)list.GetCount() )
                 break;
             n++;
             if ( n == (unsigned int)list.GetCount() )
                 break;
@@ -2365,10 +2370,11 @@ void wxPGProperty::DeleteChildren()
     }
 }
 
     }
 }
 
-void wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue),
-                                 int WXUNUSED(childIndex),
-                                 wxVariant& WXUNUSED(childValue) ) const
+wxVariant wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue),
+                                      int WXUNUSED(childIndex),
+                                      wxVariant& WXUNUSED(childValue) ) const
 {
 {
+    return wxNullVariant;
 }
 
 bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
 }
 
 bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
@@ -2678,7 +2684,7 @@ void wxPGChoices::RemoveAt(size_t nIndex, size_t count)
 {
     AllocExclusive();
 
 {
     AllocExclusive();
 
-    wxASSERT( m_data->m_refCount != 0xFFFFFFF );
+    wxASSERT( m_data->GetRefCount() != -1 );
     m_data->m_items.erase(m_data->m_items.begin()+nIndex,
                           m_data->m_items.begin()+nIndex+count);
 }
     m_data->m_items.erase(m_data->m_items.begin()+nIndex,
                           m_data->m_items.begin()+nIndex+count);
 }
@@ -2794,7 +2800,7 @@ void wxPGChoices::AllocExclusive()
 {
     EnsureData();
 
 {
     EnsureData();
 
-    if ( m_data->m_refCount != 1 )
+    if ( m_data->GetRefCount() != 1 )
     {
         wxPGChoicesData* data = new wxPGChoicesData();
         data->CopyDataFrom(m_data);
     {
         wxPGChoicesData* data = new wxPGChoicesData();
         data->CopyDataFrom(m_data);
@@ -2812,7 +2818,7 @@ void wxPGChoices::AssignData( wxPGChoicesData* data )
     if ( data != wxPGChoicesEmptyData )
     {
         m_data = data;
     if ( data != wxPGChoicesEmptyData )
     {
         m_data = data;
-        data->m_refCount++;
+        data->IncRef();
     }
 }
 
     }
 }