aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-10-17 22:49:46 +0000
committerrowanbeentje <rowan@beent.je>2011-10-17 22:49:46 +0000
commita60219ad6b0d6988635f6cde44a6c6335872f439 (patch)
tree4648ec1d98a209c0daf6d34ad712a2e554c401f9 /Source
parent02860c5fac3244ad86d2699611f220746aef2f56 (diff)
downloadsequelpro-a60219ad6b0d6988635f6cde44a6c6335872f439.tar.gz
sequelpro-a60219ad6b0d6988635f6cde44a6c6335872f439.tar.bz2
sequelpro-a60219ad6b0d6988635f6cde44a6c6335872f439.zip
- Update code to use NSStrings for NSTableColumn identifiers, as per 10.7 SDK
- Update localizable strings
Diffstat (limited to 'Source')
-rw-r--r--Source/SPCopyTable.m18
-rw-r--r--Source/SPCustomQuery.h2
-rw-r--r--Source/SPCustomQuery.m59
-rw-r--r--Source/SPTableContent.h2
-rw-r--r--Source/SPTableContent.m66
-rw-r--r--Source/SPTableData.m4
6 files changed, 62 insertions, 89 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m
index 857b45c3..bfd00c49 100644
--- a/Source/SPCopyTable.m
+++ b/Source/SPCopyTable.m
@@ -152,7 +152,7 @@ static const NSInteger kBlobAsImageFile = 4;
// Create an array of table column mappings for fast iteration
NSUInteger *columnMappings = malloc(numColumns * sizeof(NSUInteger));
for ( c = 0; c < numColumns; c++ )
- columnMappings[c] = [[NSArrayObjectAtIndex(columns, c) identifier] unsignedIntValue];
+ columnMappings[c] = (NSUInteger)[[NSArrayObjectAtIndex(columns, c) identifier] integerValue];
// Loop through the rows, adding their descriptive contents
NSUInteger rowIndex = [selectedRows firstIndex];
@@ -290,7 +290,7 @@ static const NSInteger kBlobAsImageFile = 4;
// Create an array of table column mappings for fast iteration
NSUInteger *columnMappings = malloc(numColumns * sizeof(NSUInteger));
for ( c = 0; c < numColumns; c++ )
- columnMappings[c] = [[NSArrayObjectAtIndex(columns, c) identifier] unsignedIntValue];
+ columnMappings[c] = (NSUInteger)[[NSArrayObjectAtIndex(columns, c) identifier] integerValue];
// Loop through the rows, adding their descriptive contents
NSUInteger rowIndex = [selectedRows firstIndex];
@@ -432,7 +432,7 @@ static const NSInteger kBlobAsImageFile = 4;
for (c = 0; c < numColumns; c++)
{
- columnMappings[c] = [[NSArrayObjectAtIndex(columns, c) identifier] unsignedIntValue];
+ columnMappings[c] = (NSUInteger)[[NSArrayObjectAtIndex(columns, c) identifier] integerValue];
NSString *t = [NSArrayObjectAtIndex(columnDefinitions, columnMappings[c]) objectForKey:@"typegrouping"];
@@ -611,7 +611,7 @@ static const NSInteger kBlobAsImageFile = 4;
// Create an array of table column mappings for fast iteration
NSUInteger *columnMappings = malloc(numColumns * sizeof(NSUInteger));
for ( c = 0; c < numColumns; c++ )
- columnMappings[c] = [[NSArrayObjectAtIndex(columns, c) identifier] unsignedIntValue];
+ columnMappings[c] = (NSUInteger)[[NSArrayObjectAtIndex(columns, c) identifier] integerValue];
// Loop through the rows, adding their descriptive contents
NSUInteger rowIndex = [selectedRows firstIndex];
@@ -711,7 +711,7 @@ static const NSInteger kBlobAsImageFile = 4;
if ([[NSThread currentThread] isCancelled]) return nil;
columnWidth = [self autodetectWidthForColumnDefinition:columnDefinition maxRows:100];
- [columnWidths setObject:[NSNumber numberWithUnsignedInteger:columnWidth] forKey:[columnDefinition objectForKey:@"datacolumnindex"]];
+ [columnWidths setObject:[NSString stringWithFormat:@"%llu", columnWidth] forKey:[columnDefinition objectForKey:@"datacolumnindex"]];
allColumnWidths += columnWidth;
}
@@ -721,7 +721,7 @@ static const NSInteger kBlobAsImageFile = 4;
// Look for columns that are wider than the multi-column max
for (NSString *columnIdentifier in columnWidths) {
- columnWidth = [[columnWidths objectForKey:columnIdentifier] unsignedIntegerValue];
+ columnWidth = [[columnWidths objectForKey:columnIdentifier] integerValue];
if (columnWidth > SP_MAX_CELL_WIDTH_MULTICOLUMN) availableWidthToReduce += columnWidth - SP_MAX_CELL_WIDTH_MULTICOLUMN;
}
@@ -733,7 +733,7 @@ static const NSInteger kBlobAsImageFile = 4;
if (widthToReduce) {
NSArray *columnIdentifiers = [columnWidths allKeys];
for (NSString *columnIdentifier in columnIdentifiers) {
- columnWidth = [[columnWidths objectForKey:columnIdentifier] unsignedIntegerValue];
+ columnWidth = [[columnWidths objectForKey:columnIdentifier] integerValue];
if (columnWidth > SP_MAX_CELL_WIDTH_MULTICOLUMN) {
columnWidth -= ceil((double)(columnWidth - SP_MAX_CELL_WIDTH_MULTICOLUMN) / availableWidthToReduce * widthToReduce);
[columnWidths setObject:[NSNumber numberWithUnsignedInteger:columnWidth] forKey:columnIdentifier];
@@ -762,7 +762,7 @@ static const NSInteger kBlobAsImageFile = 4;
#else
NSFont *tableFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]];
#endif
- NSUInteger columnIndex = [[columnDefinition objectForKey:@"datacolumnindex"] unsignedIntegerValue];
+ NSUInteger columnIndex = (NSUInteger)[[columnDefinition objectForKey:@"datacolumnindex"] integerValue];
NSDictionary *stringAttributes = [NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName];
Class mcpGeometryData = [MCPGeometryData class];
@@ -1330,7 +1330,7 @@ static const NSInteger kBlobAsImageFile = 4;
NSUInteger *columnMappings = malloc(numColumns * sizeof(NSUInteger));
NSUInteger c;
for ( c = 0; c < numColumns; c++ )
- columnMappings[c] = [[NSArrayObjectAtIndex(columns, c) identifier] unsignedIntValue];
+ columnMappings[c] = (NSUInteger)[[NSArrayObjectAtIndex(columns, c) identifier] integerValue];
NSMutableString *tableMetaData = [NSMutableString string];
if([[self delegate] isKindOfClass:[SPCustomQuery class]]) {
diff --git a/Source/SPCustomQuery.h b/Source/SPCustomQuery.h
index 014fc599..5c4a4186 100644
--- a/Source/SPCustomQuery.h
+++ b/Source/SPCustomQuery.h
@@ -279,7 +279,7 @@
- (NSString *)usedQuery;
- (NSString *)argumentForRow:(NSUInteger)rowIndex ofTable:(NSString *)tableForColumn andDatabase:(NSString *)database includeBlobs:(BOOL)includeBlobs;
- (void)saveCellValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSUInteger)rowIndex;
-- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSNumber *)columnIndex;
+- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSInteger)columnIndex;
- (NSUInteger)numberOfQueries;
- (NSRange)currentQueryRange;
- (NSString *)buildHistoryString;
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 0d43d828..63ba3bab 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -1618,15 +1618,6 @@
[customQueryView addTableColumn:theCol];
[theCol release];
}
-
- [customQueryView sizeLastColumnToFit];
-
- //tries to fix problem with last row (otherwise to small)
- //sets last column to width of the first if smaller than 30
- //problem not fixed for resizing window
- if ( [[customQueryView tableColumnWithIdentifier:[NSNumber numberWithInteger:[theColumns count]-1]] width] < 30 )
- [[customQueryView tableColumnWithIdentifier:[NSNumber numberWithInteger:[theColumns count]-1]]
- setWidth:[[customQueryView tableColumnWithIdentifier:[NSNumber numberWithInteger:0]] width]];
}
/**
@@ -1708,7 +1699,7 @@
// Otherwise set the column width
NSTableColumn *aTableColumn = [customQueryView tableColumnWithIdentifier:[columnDefinition objectForKey:@"datacolumnindex"]];
- NSUInteger targetWidth = [[columnWidths objectForKey:[columnDefinition objectForKey:@"datacolumnindex"]] unsignedIntegerValue];
+ NSUInteger targetWidth = [[columnWidths objectForKey:[columnDefinition objectForKey:@"datacolumnindex"]] integerValue];
[aTableColumn setWidth:targetWidth];
}
[customQueryView setDelegate:self];
@@ -1724,17 +1715,9 @@
* -2 for other errors
* and the used WHERE clause to identify
*/
-- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSNumber*)columnIndex
+- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSInteger)columnIndex
{
- NSDictionary *columnDefinition = nil;
-
- // Retrieve the column defintion
- for(id c in cqColumnDefinition) {
- if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:columnIndex]) {
- columnDefinition = [NSDictionary dictionaryWithDictionary:c];
- break;
- }
- }
+ NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[customQueryView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]];
if(!columnDefinition)
return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-2], @"", nil];
@@ -1908,7 +1891,7 @@
NSString *columnName = [columnDefinition objectForKey:@"org_name"];
// Check if the IDstring identifies the current field bijectively and get the WHERE clause
- NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[aTableColumn identifier]];
+ NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[[aTableColumn identifier] integerValue]];
fieldIDQueryString = [editStatus objectAtIndex:1];
NSInteger numberOfPossibleUpdateRows = [[editStatus objectAtIndex:0] integerValue];
@@ -2109,7 +2092,7 @@
// Sets column order as tri-state descending, ascending, no sort, descending, ascending etc. order if the same
// header is clicked several times
- if (sortField && [[tableColumn identifier] isEqualToNumber:sortField]) {
+ if (sortField && [[tableColumn identifier] integerValue] == [sortField integerValue]) {
if(isDesc) {
[sortField release];
sortField = nil;
@@ -2120,7 +2103,7 @@
}
} else {
isDesc = NO;
- [[customQueryView onMainThread] setIndicatorImage:nil inTableColumn:[customQueryView tableColumnWithIdentifier:sortField]];
+ [[customQueryView onMainThread] setIndicatorImage:nil inTableColumn:[customQueryView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", [sortField integerValue]]]];
if (sortField) [sortField release];
sortField = [[NSNumber alloc] initWithInteger:[[tableColumn identifier] integerValue]];
}
@@ -2344,7 +2327,7 @@
// cases.
if (isWorking) {
pthread_mutex_lock(&resultDataLock);
- if (row < resultDataCount && [[aTableColumn identifier] unsignedIntegerValue] < [resultData columnCount]) {
+ if (row < resultDataCount && (NSUInteger)[[aTableColumn identifier] integerValue] < [resultData columnCount]) {
theValue = [[SPDataStorageObjectAtRowAndColumn(resultData, row, [[aTableColumn identifier] integerValue]) copy] autorelease];
}
pthread_mutex_unlock(&resultDataLock);
@@ -2415,7 +2398,13 @@
editedRow = rowIndex;
editedScrollViewRect = [customQueryScrollView documentVisibleRect];
- NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[aTableColumn identifier]];
+ NSInteger editedColumn = 0;
+ for (NSTableColumn* col in [customQueryView tableColumns]) {
+ if([[col identifier] isEqualToString:[aTableColumn identifier]]) break;
+ editedColumn++;
+ }
+
+ NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[[aTableColumn identifier] integerValue]];
isFieldEditable = ([[editStatus objectAtIndex:0] integerValue] == 1) ? YES : NO;
NSString *fieldType = nil;
@@ -2456,8 +2445,8 @@
withWindow:[tableDocumentInstance parentWindow]
sender:self
contextInfo:[NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInteger:rowIndex], @"row",
- [aTableColumn identifier], @"column",
+ [NSNumber numberWithInteger:rowIndex], @"rowIndex",
+ [NSNumber numberWithInteger:editedColumn], @"columnIndex",
[NSNumber numberWithBool:isFieldEditable], @"isFieldEditable",
nil]];
@@ -3676,15 +3665,15 @@
NSInteger column = -1;
if(contextInfo) {
- row = [[contextInfo objectForKey:@"row"] integerValue];
- column = [[contextInfo objectForKey:@"column"] integerValue];
+ row = [[contextInfo objectForKey:@"rowIndex"] integerValue];
+ column = [[contextInfo objectForKey:@"columnIndex"] integerValue];
}
if (data && contextInfo) {
BOOL isResultFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO;
if(isResultFieldEditable) {
- [self saveCellValue:[[data copy] autorelease] forTableColumn:[customQueryView tableColumnWithIdentifier:[contextInfo objectForKey:@"column"]] row:row];
+ [self saveCellValue:[[data copy] autorelease] forTableColumn:[[customQueryView tableColumns] objectAtIndex:column] row:row];
}
}
@@ -3821,17 +3810,11 @@
column = [customQueryView editedColumn];
// Retrieve the column definition
- NSNumber *colIdentifier = [NSArrayObjectAtIndex([customQueryView tableColumns], column) identifier];
- for(id c in cqColumnDefinition) {
- if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:colIdentifier]) {
- columnDefinition = [NSDictionary dictionaryWithDictionary:c];
- break;
- }
- }
+ columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[customQueryView tableColumns] objectAtIndex:column] identifier] integerValue]]];
if(!columnDefinition) return NO;
- NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:colIdentifier];
+ NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:column];
NSInteger numberOfPossibleUpdateRows = [NSArrayObjectAtIndex(editStatus, 0) integerValue];
NSPoint pos = [[tableDocumentInstance parentWindow] convertBaseToScreen:[customQueryView convertPoint:[customQueryView frameOfCellAtColumn:column row:row].origin toView:nil]];
pos.y -= 20;
diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h
index 4592de53..cc965e19 100644
--- a/Source/SPTableContent.h
+++ b/Source/SPTableContent.h
@@ -257,7 +257,7 @@
- (void)openContentFilterManager;
- (void)makeContentFilterHaveFocus;
-- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSNumber *)columnIndex;
+- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSInteger)columnIndex;
- (void)updateFilterTableClause:(id)currentValue;
- (NSString*)escapeFilterTableDefaultOperator:(NSString*)anOperator;
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 58c6d10c..68b3ae55 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -338,12 +338,10 @@
- (void) setTableDetails:(NSDictionary *)tableDetails
{
NSString *newTableName;
- NSInteger i;
- NSNumber
+ NSInteger i, sortColumnNumberToRestore = NSNotFound;
#ifndef SP_REFACTOR
- *colWidth,
+ NSNumber *colWidth;
#endif
- *sortColumnNumberToRestore = nil;
NSArray *columnNames;
NSDictionary *columnDefinition;
NSTableColumn *theCol;
@@ -621,7 +619,7 @@
// Set the column to be reselected for sorting if appropriate
if (sortColumnToRestore && [sortColumnToRestore isEqualToString:[columnDefinition objectForKey:@"name"]])
- sortColumnNumberToRestore = [columnDefinition objectForKey:@"datacolumnindex"];
+ sortColumnNumberToRestore = [[columnDefinition objectForKey:@"datacolumnindex"] integerValue];
// Add the column to the table
[tableContentView addTableColumn:theCol];
@@ -635,10 +633,10 @@
#endif
// If the table has been reloaded and the previously selected sort column is still present, reselect it.
- if (sortColumnNumberToRestore) {
- theCol = [tableContentView tableColumnWithIdentifier:sortColumnNumberToRestore];
+ if (sortColumnNumberToRestore != NSNotFound) {
+ theCol = [tableContentView tableColumnWithIdentifier:[NSString stringWithFormat:@"lld", sortColumnNumberToRestore]];
if (sortCol) [sortCol release];
- sortCol = [sortColumnNumberToRestore copy];
+ sortCol = [[NSNumber alloc] initWithInteger:sortColumnNumberToRestore];
[tableContentView setHighlightedTableColumn:theCol];
isDesc = !sortColumnToRestoreIsAsc;
if ( isDesc ) {
@@ -792,7 +790,7 @@
if (contentPage <= 0)
contentPage = 1;
else if (contentPage > 1 && (NSInteger)(contentPage - 1) * [prefs integerForKey:SPLimitResultsValue] >= maxNumRows)
- contentPage = ceil((CGFloat)maxNumRows / [prefs floatForKey:SPLimitResultsValue]);
+ contentPage = ceilf((CGFloat)maxNumRows / [prefs floatForKey:SPLimitResultsValue]);
// If the result set is from a late page, take a copy of the string to allow resetting limit
// if no results are found
@@ -3093,17 +3091,11 @@
* -2 for other errors
* and the used WHERE clause to identify
*/
-- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSNumber *)columnIndex
+- (NSArray*)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSInteger)columnIndex
{
- NSDictionary *columnDefinition = nil;
// Retrieve the column defintion
- for(id c in cqColumnDefinition) {
- if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:columnIndex]) {
- columnDefinition = [NSDictionary dictionaryWithDictionary:c];
- break;
- }
- }
+ NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[tableContentView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]];
if(!columnDefinition)
return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-2], @"", nil];
@@ -3234,15 +3226,14 @@
NSInteger row = -1;
NSInteger column = -1;
- NSInteger editedColumn = -1;
if(contextInfo) {
- row = [[contextInfo objectForKey:@"row"] integerValue];
- column = [[contextInfo objectForKey:@"column"] integerValue];
- editedColumn = [[contextInfo objectForKey:@"editedColumn"] integerValue];
+ row = [[contextInfo objectForKey:@"rowIndex"] integerValue];
+ column = [[contextInfo objectForKey:@"columnIndex"] integerValue];
}
if (data && contextInfo) {
+ NSTableColumn *theTableColumn = [[tableContentView tableColumns] objectAtIndex:column];
BOOL isFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO;
if (!isEditingRow && [tablesListInstance tableType] != SPTableTypeView) {
[oldRow setArray:[tableValues rowContentsAtIndex:row]];
@@ -3251,7 +3242,7 @@
}
if ([data isKindOfClass:[NSString class]]
- && [data isEqualToString:[prefs objectForKey:SPNullValue]] && [[NSArrayObjectAtIndex(dataColumns, column) objectForKey:@"null"] boolValue])
+ && [data isEqualToString:[prefs objectForKey:SPNullValue]] && [[NSArrayObjectAtIndex(dataColumns, [[theTableColumn identifier] integerValue]) objectForKey:@"null"] boolValue])
{
data = [[NSNull null] retain];
}
@@ -3262,11 +3253,11 @@
isEditingRow = NO;
// update the field and refresh the table
- [self saveViewCellValue:[[data copy] autorelease] forTableColumn:[tableContentView tableColumnWithIdentifier:[contextInfo objectForKey:@"column"]] row:row];
+ [self saveViewCellValue:[[data copy] autorelease] forTableColumn:theTableColumn row:row];
// Otherwise, in tables, save back to the row store
} else {
- [tableValues replaceObjectInRow:row column:column withObject:[[data copy] autorelease]];
+ [tableValues replaceObjectInRow:row column:[[theTableColumn identifier] integerValue] withObject:[[data copy] autorelease]];
}
}
}
@@ -3278,8 +3269,8 @@
[[tableContentView window] makeFirstResponder:tableContentView];
- if(row > -1 && editedColumn > -1)
- [tableContentView editColumn:editedColumn row:row withEvent:nil select:YES];
+ if(row > -1 && column > -1)
+ [tableContentView editColumn:column row:row withEvent:nil select:YES];
}
- (void)saveViewCellValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSUInteger)rowIndex
@@ -3310,7 +3301,7 @@
[self storeCurrentDetailsForRestoration];
// Check if the IDstring identifies the current field bijectively and get the WHERE clause
- NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[aTableColumn identifier]];
+ NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[[aTableColumn identifier] integerValue]];
NSString *fieldIDQueryStr = [editStatus objectAtIndex:1];
NSInteger numberOfPossibleUpdateRows = [[editStatus objectAtIndex:0] integerValue];
@@ -3895,7 +3886,7 @@
// Otherwise set the column width
NSTableColumn *aTableColumn = [tableContentView tableColumnWithIdentifier:[columnDefinition objectForKey:@"datacolumnindex"]];
- NSUInteger targetWidth = [[columnWidths objectForKey:[columnDefinition objectForKey:@"datacolumnindex"]] unsignedIntegerValue];
+ NSInteger targetWidth = [[columnWidths objectForKey:[columnDefinition objectForKey:@"datacolumnindex"]] integerValue];
[aTableColumn setWidth:targetWidth];
}
[tableContentView setDelegate:self];
@@ -4108,7 +4099,7 @@
// writing in gray if value was NULL
if ([aTableView editedColumn] != -1
&& [aTableView editedRow] == rowIndex
- && [[NSArrayObjectAtIndex([aTableView tableColumns], [aTableView editedColumn]) identifier] unsignedIntegerValue] == columnIndex) {
+ && (NSUInteger)[[NSArrayObjectAtIndex([aTableView tableColumns], [aTableView editedColumn]) identifier] integerValue] == columnIndex) {
[cell setTextColor:blackColor];
return;
}
@@ -4214,7 +4205,7 @@
// Sets column order as tri-state descending, ascending, no sort, descending, ascending etc. order if the same
// header is clicked several times
- if ([[tableColumn identifier] isEqualTo:sortCol]) {
+ if (sortCol && [[tableColumn identifier] integerValue] == [sortCol integerValue]) {
if(isDesc) {
[sortCol release];
sortCol = nil;
@@ -4225,12 +4216,12 @@
}
} else {
isDesc = NO;
- [[tableContentView onMainThread] setIndicatorImage:nil inTableColumn:[tableContentView tableColumnWithIdentifier:sortCol]];
+ [[tableContentView onMainThread] setIndicatorImage:nil inTableColumn:[tableContentView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", [sortCol integerValue]]]];
if (sortCol) [sortCol release];
sortCol = [[NSNumber alloc] initWithInteger:[[tableColumn identifier] integerValue]];
}
- if(sortCol) {
+ if (sortCol) {
// Set the highlight and indicatorImage
[[tableContentView onMainThread] setHighlightedTableColumn:tableColumn];
if (isDesc) {
@@ -4437,7 +4428,7 @@
// Check for Views if field is editable
if([tablesListInstance tableType] == SPTableTypeView) {
- NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[aTableColumn identifier]];
+ NSArray *editStatus = [self fieldEditStatusForRow:rowIndex andColumn:[[aTableColumn identifier] integerValue]];
isFieldEditable = ([[editStatus objectAtIndex:0] integerValue] == 1) ? YES : NO;
}
@@ -4472,7 +4463,7 @@
NSInteger editedColumn = 0;
for(NSTableColumn* col in [tableContentView tableColumns]) {
- if([[col identifier] isEqualToNumber:[aTableColumn identifier]]) break;
+ if([[col identifier] isEqualToString:[aTableColumn identifier]]) break;
editedColumn++;
}
@@ -4484,9 +4475,8 @@
withWindow:[tableDocumentInstance parentWindow]
sender:self
contextInfo:[NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInteger:rowIndex], @"row",
- [aTableColumn identifier], @"column",
- [NSNumber numberWithInteger:editedColumn], @"editedColumn",
+ [NSNumber numberWithInteger:rowIndex], @"rowIndex",
+ [NSNumber numberWithInteger:editedColumn], @"columnIndex",
[NSNumber numberWithBool:isFieldEditable], @"isFieldEditable",
nil]];
@@ -4734,7 +4724,7 @@
// from the keyboard show an error tooltip
// or bypass if numberOfPossibleUpdateRows == 1
if([tableContentView isCellEditingMode]) {
- NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:[NSArrayObjectAtIndex([tableContentView tableColumns], column) identifier]];
+ NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:[[NSArrayObjectAtIndex([tableContentView tableColumns], column) identifier] integerValue]];
NSInteger numberOfPossibleUpdateRows = [[editStatus objectAtIndex:0] integerValue];
NSPoint pos = [[tableDocumentInstance parentWindow] convertBaseToScreen:[tableContentView convertPoint:[tableContentView frameOfCellAtColumn:column row:row].origin toView:nil]];
pos.y -= 20;
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index f2c00c15..554b3e36 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -590,7 +590,7 @@
}
[fieldsParser setIgnoreCommentStrings:NO];
- [tableColumn setObject:[NSNumber numberWithInteger:[tableColumns count]] forKey:@"datacolumnindex"];
+ [tableColumn setObject:[NSString stringWithFormat:@"%llu", [tableColumns count]] forKey:@"datacolumnindex"];
[tableColumn setObject:fieldName forKey:@"name"];
// Split the remaining field definition string by spaces and process
@@ -872,7 +872,7 @@
resultRow = [theResult fetchRowAsDictionary];
// Add the column index and name
- [tableColumn setObject:[NSNumber numberWithInteger:[tableColumns count]] forKey:@"datacolumnindex"];
+ [tableColumn setObject:[NSString stringWithFormat:@"%llu", [tableColumns count]] forKey:@"datacolumnindex"];
[tableColumn setObject:[NSString stringWithString:[resultRow objectForKey:@"Field"]] forKey:@"name"];
// Populate type, length, and other available details from the Type columns