]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ctrlsub.cpp
Generate text events in generic wxSpinCtrl itself.
[wxWidgets.git] / src / common / ctrlsub.cpp
index 68d4b1a5916150f05b753abca0a2c6d77307e0f2..388af3e6ffb77501e18589e4ae79c5aed5418838 100644 (file)
@@ -165,6 +165,8 @@ void wxItemContainer::SetClientObject(unsigned int n, wxClientData *data)
     wxASSERT_MSG( !HasClientUntypedData(),
                   wxT("can't have both object and void client data") );
 
+    wxCHECK_RET( IsValid(n), "Invalid index passed to SetClientObject()" );
+
     if ( HasClientObjectData() )
     {
         wxClientData * clientDataOld
@@ -188,6 +190,9 @@ wxClientData *wxItemContainer::GetClientObject(unsigned int n) const
     wxCHECK_MSG( HasClientObjectData(), NULL,
                   wxT("this window doesn't have object client data") );
 
+    wxCHECK_MSG( IsValid(n), NULL,
+                 "Invalid index passed to GetClientObject()" );
+
     return static_cast<wxClientData *>(DoGetItemClientData(n));
 }
 
@@ -214,6 +219,8 @@ void wxItemContainer::SetClientData(unsigned int n, void *data)
     wxASSERT_MSG( HasClientUntypedData(),
                   wxT("can't have both object and void client data") );
 
+    wxCHECK_RET( IsValid(n), "Invalid index passed to SetClientData()" );
+
     DoSetItemClientData(n, data);
 }
 
@@ -222,6 +229,9 @@ void *wxItemContainer::GetClientData(unsigned int n) const
     wxCHECK_MSG( HasClientUntypedData(), NULL,
                   wxT("this window doesn't have void client data") );
 
+    wxCHECK_MSG( IsValid(n), NULL,
+                 "Invalid index passed to GetClientData()" );
+
     return DoGetItemClientData(n);
 }