Permalink
Browse files

Fix an issue where copying the contents of a TEXT/BLOB field from a c…

…ustom query result would not contain all data if keyboard navigation was used (#2283)
  • Loading branch information...
dmoagx committed Oct 12, 2015
1 parent d1323f0 commit 8c7fc9deaa3d005e0bf2afd6db5d5fa9bb63cf62
Showing with 6 additions and 6 deletions.
  1. +6 −6 Source/SPCustomQuery.m
@@ -2111,7 +2111,10 @@ - (void)tableView:(SPCopyTable *)aTableView willDisplayCell:(id)cell forTableCol
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
{
if (aTableView == customQueryView) {
return [self _resultDataItemAtRow:rowIndex columnIndex:[[tableColumn identifier] integerValue] preserveNULLs:NO asPreview:YES];
NSUInteger columnIndex = [[tableColumn identifier] integerValue];
// if a user enters the field by keyboard navigation they might want to copy the contents without invoking the field editor sheet first
BOOL forEditing = ([customQueryView editedColumn] == (NSInteger)columnIndex && [customQueryView editedRow] == rowIndex);
return [self _resultDataItemAtRow:rowIndex columnIndex:[[tableColumn identifier] integerValue] preserveNULLs:NO asPreview:(forEditing != YES)];
}
return @"";
@@ -3996,6 +3999,7 @@ - (void)awakeFromNib
*/
- (id)_resultDataItemAtRow:(NSInteger)row columnIndex:(NSUInteger)column preserveNULLs:(BOOL)preserveNULLs asPreview:(BOOL)asPreview;
{
#warning duplicate code with SPTableContentDataSource.m tableView:objectValueForTableColumn:…
id value = nil;
// While the table is being loaded, additional validation is required - data
@@ -4006,11 +4010,7 @@ - (id)_resultDataItemAtRow:(NSInteger)row columnIndex:(NSUInteger)column preserv
pthread_mutex_lock(&resultDataLock);
if (row < resultDataCount && column < [resultData columnCount]) {
if (asPreview) {
value = SPDataStoragePreviewAtRowAndColumn(resultData, row, column, 150);
} else {
value = SPDataStorageObjectAtRowAndColumn(resultData, row, column);
}
value = SPDataStoragePreviewAtRowAndColumn(resultData, row, column, 150);
}
pthread_mutex_unlock(&resultDataLock);

0 comments on commit 8c7fc9d

Please sign in to comment.