From 4b13d761590d65d2b294aaa6c17654edbd0a811e Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sat, 13 Mar 2010 19:32:15 +0000 Subject: tiny improvement for printDocument: menu item validation --- Source/TableDocument.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/TableDocument.m b/Source/TableDocument.m index b32cc2bb..d021ae5c 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -2992,8 +2992,13 @@ return ([self database] != nil && [self table] != nil); } - if ([menuItem action] == @selector(printDocument:)) { - return (([self database] != nil) && ([[tablesListInstance valueForKeyPath:@"tablesListView"] numberOfSelectedRows] == 1)); + if ([menuItem action] == @selector(printDocument:)) { + return ( + [self database] != nil + && [[tablesListInstance valueForKeyPath:@"tablesListView"] numberOfSelectedRows] == 1 + // if Custom Query Tab is active the textView will handle printDocument if it's first responder + && [tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] != 2 + ); } if ([menuItem action] == @selector(chooseEncoding:)) { -- cgit v1.2.3