|
54 | 54 | @interface SPTableContent (SPDeclaredAPI)
|
55 | 55 |
|
56 | 56 | - (BOOL)cancelRowEditing;
|
| 57 | +- (BOOL)cellValueIsDisplayedAsHexForColumn:(NSUInteger)columnIndex; |
57 | 58 |
|
58 | 59 | @end
|
59 | 60 |
|
@@ -273,7 +274,7 @@ - (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn
|
273 | 274 | NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]];
|
274 | 275 |
|
275 | 276 | // TODO: Fix editing of "Display as Hex" columns and remove this (also see above)
|
276 |
| - if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { |
| 277 | + if ([self cellValueIsDisplayedAsHexForColumn:[[tableColumn identifier] integerValue]]) { |
277 | 278 | NSBeep();
|
278 | 279 | [SPTooltip showWithObject:NSLocalizedString(@"Disable \"Display Binary Data as Hex\" in the View menu to edit this field.",@"Temporary : Tooltip shown when trying to edit a binary field in table content view while it is displayed using HEX conversion")];
|
279 | 280 | return NO;
|
@@ -330,7 +331,7 @@ - (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn
|
330 | 331 | cellValue = [NSString stringWithString:[prefs objectForKey:SPNullValue]];
|
331 | 332 | }
|
332 | 333 |
|
333 |
| - if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { |
| 334 | + if ([self cellValueIsDisplayedAsHexForColumn:[[tableColumn identifier] integerValue]]) { |
334 | 335 | [fieldEditor setTextMaxLength:[[self tableView:tableContentView objectValueForTableColumn:tableColumn row:rowIndex] length]];
|
335 | 336 | isFieldEditable = NO;
|
336 | 337 | }
|
@@ -521,13 +522,7 @@ - (void)tableView:(SPCopyTable *)tableView willDisplayCell:(id)cell forTableColu
|
521 | 522 |
|
522 | 523 | NSDictionary *columnDefinition = [[(id <SPDatabaseContentViewDelegate>)[tableContentView delegate] dataColumnDefinitions] objectAtIndex:columnIndex];
|
523 | 524 |
|
524 |
| - NSString *columnType = [columnDefinition objectForKey:@"typegrouping"]; |
525 |
| - |
526 |
| - // Find a more reliable way of doing this check |
527 |
| - if ([columnType isEqualToString:@"binary"] && |
528 |
| - [prefs boolForKey:SPDisplayBinaryDataAsHex] && |
529 |
| - [[self tableView:tableContentView objectValueForTableColumn:tableColumn row:rowIndex] hasPrefix:@"0x"]) { |
530 |
| - |
| 525 | + if ([self cellValueIsDisplayedAsHexForColumn:[[tableColumn identifier] integerValue]]) { |
531 | 526 | [cell setTextColor:rowIndex == [tableContentView selectedRow] ? whiteColor : blueColor];
|
532 | 527 | }
|
533 | 528 |
|
|
0 commit comments