From 06eb488d2faf56886fd058e018aa3302b185a19d Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 10 Feb 2016 22:16:57 +0100 Subject: Fix an issue where copying the contents of a TEXT/BLOB field from a custom query result would not contain all data if keyboard navigation was used (#2283) backport of 8c7fc9deaa3d005e0bf2afd6db5d5fa9bb63cf62 --- Source/SPCustomQuery.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source') diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 9289f2ce..9dce1f70 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -2111,7 +2111,10 @@ - (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 @""; @@ -3988,6 +3991,7 @@ */ - (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 @@ -3998,11 +4002,7 @@ 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); -- cgit v1.2.3