Merge 772bfad79f
into fea45b2d5b
This commit is contained in:
commit
6a407ae58d
|
@ -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 = {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue