diff options
Diffstat (limited to 'Source/SPTableContentDataSource.m')
-rw-r--r-- | Source/SPTableContentDataSource.m | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Source/SPTableContentDataSource.m b/Source/SPTableContentDataSource.m index c49169a0..8ffa2c69 100644 --- a/Source/SPTableContentDataSource.m +++ b/Source/SPTableContentDataSource.m @@ -39,6 +39,12 @@ #import <pthread.h> #import <SPMySQL/SPMySQL.h> +@interface SPTableContent (SPTableContentDataSource_Private_API) + +- (id)_contentValueForTableColumn:(NSUInteger)columnIndex row:(NSUInteger)rowIndex asPreview:(BOOL)asPreview; + +@end + @implementation SPTableContent (SPTableContentDataSource) #pragma mark - @@ -91,7 +97,7 @@ pthread_mutex_lock(&tableValuesLock); if (rowIndex < (NSInteger)tableRowsCount && columnIndex < [tableValues columnCount]) { - value = [[SPDataStorageObjectAtRowAndColumn(tableValues, rowIndex, columnIndex) copy] autorelease]; + value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:YES]; } pthread_mutex_unlock(&tableValuesLock); @@ -99,7 +105,11 @@ if (!value) return @"..."; } else { - value = SPDataStorageObjectAtRowAndColumn(tableValues, rowIndex, columnIndex); + if ([tableView editedColumn] == (NSInteger)columnIndex && [tableView editedRow] == rowIndex) { + value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:NO]; + } else { + value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:YES]; + } } if ([value isKindOfClass:[SPMySQLGeometryData class]]) @@ -185,3 +195,15 @@ } @end + +@implementation SPTableContent (SPTableContentDataSource_Private_API) + +- (id)_contentValueForTableColumn:(NSUInteger)columnIndex row:(NSUInteger)rowIndex asPreview:(BOOL)asPreview +{ + if (asPreview) { + return SPDataStoragePreviewAtRowAndColumn(tableValues, rowIndex, columnIndex, 150); + } + return SPDataStorageObjectAtRowAndColumn(tableValues, rowIndex, columnIndex); +} + +@end |