aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseViewController.m')
-rw-r--r--Source/SPDatabaseViewController.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m
index ea2186cc..a1ec3e30 100644
--- a/Source/SPDatabaseViewController.m
+++ b/Source/SPDatabaseViewController.m
@@ -615,16 +615,17 @@
if(!correspondingWindowFound) stopTrigger = YES;
}
if(!stopTrigger) {
+ id firstResponder = [[NSApp keyWindow] firstResponder];
if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) {
[[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem];
}
else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) {
- if([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"])
- [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForDataTable:aMenuItem];
+ if([[[firstResponder class] description] isEqualToString:@"SPCopyTable"])
+ [[firstResponder onMainThread] executeBundleItemForDataTable:aMenuItem];
}
else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeInputField]) {
- if([[[NSApp mainWindow] firstResponder] isKindOfClass:[NSTextView class]])
- [[[[NSApp mainWindow] firstResponder] onMainThread] executeBundleItemForInputField:aMenuItem];
+ if([firstResponder isKindOfClass:[NSTextView class]])
+ [[firstResponder onMainThread] executeBundleItemForInputField:aMenuItem];
}
}
}