This commit is contained in:
Angelo Haller 2021-01-02 10:21:39 -05:00 committed by GitHub
commit 6a407ae58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 17 deletions

View File

@ -41,6 +41,8 @@ void uiprivTableModelSetCellValue(uiTableModel *m, int row, int column, const ui
mh = uiprivTableModelHandler(m);
(*(mh->SetCellValue))(mh, m, row, column, value);
uiTableModelRowChanged(m, row);
}
const uiTableTextColumnOptionalParams uiprivDefaultTextColumnOptionalParams = {

View File

@ -292,9 +292,6 @@ struct textColumnCreateParams {
value = uiNewTableValueString([[self->tf stringValue] UTF8String]);
uiprivTableModelSetCellValue(self->m, row, self->textModelColumn, value);
uiFreeTableValue(value);
// always refresh the value in case the model rejected it
// TODO document that we do this, but not for the whole row (or decide to do both, or do neither...)
[self uiprivUpdate:row];
}
- (IBAction)uiprivOnCheckboxAction:(id)sender
@ -306,8 +303,6 @@ struct textColumnCreateParams {
value = uiNewTableValueInt([self->cb state] != NSOffState);
uiprivTableModelSetCellValue(self->m, row, self->checkboxModelColumn, value);
uiFreeTableValue(value);
// always refresh the value in case the model rejected it
[self uiprivUpdate:row];
}
@end
@ -539,8 +534,6 @@ struct textColumnCreateParams {
row = [self->t->tv rowForView:self->b];
uiprivTableModelSetCellValue(self->m, row, self->modelColumn, NULL);
// TODO document we DON'T update the cell after doing this
// TODO or decide what to do instead
}
@end

View File

@ -168,11 +168,6 @@ HRESULT uiprivTableFinishEditingText(uiTable *t)
p = (*(t->columns))[t->editedSubitem];
uiprivTableModelSetCellValue(t->model, t->editedItem, p->textModelColumn, value);
uiFreeTableValue(value);
// always refresh the value in case the model rejected it
if (SendMessageW(t->hwnd, LVM_UPDATE, (WPARAM) (t->editedItem), 0) == (LRESULT) (-1)) {
logLastError(L"LVM_UPDATE");
return E_FAIL;
}
return uiprivTableAbortEditingText(t);
}
@ -250,11 +245,6 @@ HRESULT uiprivTableHandleNM_CLICK(uiTable *t, NMITEMACTIVATE *nm, LRESULT *lResu
uiFreeTableValue(value);
} else
uiprivTableModelSetCellValue(t->model, ht.iItem, modelColumn, NULL);
// always refresh the value in case the model rejected it
if (SendMessageW(t->hwnd, LVM_UPDATE, (WPARAM) (ht.iItem), 0) == (LRESULT) (-1)) {
logLastError(L"LVM_UPDATE");
return E_FAIL;
}
done:
*lResult = 0;