]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/databrow.cpp
1945421 applied
[wxWidgets.git] / src / mac / carbon / databrow.cpp
index a4485f8bc5a0c514014e9dc14dacbe3fa1e81e60..e9fd7f3a816dd144ba64396fb86d7ada3b887972 100644 (file)
@@ -680,6 +680,10 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
       wxCHECK_MSG(dataViewCtrlPtr->GetModel() != NULL,errDataBrowserNotConfigured,_("Pointer to model not set correctly."));
       dataViewColumnPtr = dataViewCtrlPtr->GetColumnPtr(propertyID);
       wxCHECK_MSG((dataViewColumnPtr != NULL) && (dataViewColumnPtr->GetRenderer() != NULL),errDataBrowserNotConfigured,_("There is no column or renderer for the specified column index."));
+
+      wxDataViewItem      dvItem(reinterpret_cast<void*>(itemID));
+      unsigned int        col = dataViewColumnPtr->GetModelColumn();
+            
       switch (dataViewColumnPtr->GetRenderer()->GetPropertyType())
       {
         case kDataBrowserCheckboxType:
@@ -695,14 +699,22 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
                // variable definition and initialization:
                 wxVariant modifiedData(true);
 
-                return (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()) ? OSStatus(noErr) : OSStatus(errDataBrowserNotConfigured));
+                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) &&
+                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col))
+                    return noErr;
+                else
+                    return errDataBrowserInvalidPropertyData;
               } /* if */
               else if (buttonValue == kThemeButtonOff)
               {
                // variable definition and initialization:
                 wxVariant modifiedData(false);
 
-                return (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()) ? OSStatus(noErr) : OSStatus(errDataBrowserNotConfigured));
+                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) &&
+                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col))
+                    return noErr;
+                else
+                    return errDataBrowserInvalidPropertyData;
               } /* if */
               else
                 return errDataBrowserInvalidPropertyData;
@@ -725,11 +737,12 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
               wxMacCFStringHolder modifiedString(stringReference);
 #endif
               wxVariant           modifiedData(modifiedString.AsString());
-
-              if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()))
-                return noErr;
-              else
-                return errDataBrowserNotConfigured;
+              
+                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) &&
+                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col))
+                    return noErr;
+                else
+                    return errDataBrowserInvalidPropertyData;
             } /* if */
             else
               return errorStatus;