aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2016-02-10 22:16:57 +0100
committerMax <post@wickenrode.com>2016-02-10 22:16:57 +0100
commit06eb488d2faf56886fd058e018aa3302b185a19d (patch)
treea1e8c5e89e24c1543618984b2d7194ac3821ba07
parentbb706435411ce408471568e554109a8e41c1f681 (diff)
downloadsequelpro-06eb488d2faf56886fd058e018aa3302b185a19d.tar.gz
sequelpro-06eb488d2faf56886fd058e018aa3302b185a19d.tar.bz2
sequelpro-06eb488d2faf56886fd058e018aa3302b185a19d.zip
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
-rw-r--r--Source/SPCustomQuery.m12
1 files changed, 6 insertions, 6 deletions
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);