aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-10-12 23:14:34 +0200
committerMax <post@wickenrode.com>2015-10-12 23:14:34 +0200
commit8c7fc9deaa3d005e0bf2afd6db5d5fa9bb63cf62 (patch)
tree2cc23425ba885a56258bf2b3ad1498a2f9bfe978
parentd1323f0606377919d8246a451d8b07335c2a0583 (diff)
downloadsequelpro-8c7fc9deaa3d005e0bf2afd6db5d5fa9bb63cf62.tar.gz
sequelpro-8c7fc9deaa3d005e0bf2afd6db5d5fa9bb63cf62.tar.bz2
sequelpro-8c7fc9deaa3d005e0bf2afd6db5d5fa9bb63cf62.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)
-rw-r--r--Source/SPCustomQuery.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index c344f078..c3d76d54 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 @"";
@@ -3996,6 +3999,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
@@ -4006,11 +4010,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);