From 78a2c32e9d163a558be1d221770587639a92fd6e Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 17 Sep 2010 20:54:33 +0000 Subject: - Fix a UI validation bug when adding an additional indexed field with a length specified and the advanced view open. - Fix an exception when adding the same indexed field when creating a new index. Both found by Max. Thanks Max! --- Source/SPIndexesController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index ddd80354..7302a4a5 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -320,7 +320,7 @@ NSString *SPNewIndexStorageType = @"IndexStorageType"; { [[indexedFields objectAtIndex:rowIndex] setObject:object forKey:[tableColumn identifier]]; - if ([[tableColumn identifier] isEqualToString:@"name"]) { + if ([[tableColumn identifier] isEqualToString:@"name"] && [object isKindOfClass:[NSDictionary class]]) { // If the field type is foud within the requires length array then a length prefix is required so // display the size column. if ([requiresLength containsObject:[[object objectForKey:@"type"] uppercaseString]]) [indexSizeTableColumn setHidden:NO]; @@ -560,7 +560,9 @@ NSString *SPNewIndexStorageType = @"IndexStorageType"; if ([requiresLength containsObject:[[field objectForKey:@"type"] uppercaseString]]) c++; } - [indexSizeTableColumn setHidden:(!c)]; + // Only toggle the sizes column if the advanced view is hidden + if (!showAdvancedView) [indexSizeTableColumn setHidden:(!c)]; + [confirmAddIndexButton setEnabled:(!c)]; [indexedColumnsTableView reloadData]; -- cgit v1.2.3