Revision: 18492
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18492&view=rev
Author:   hofman
Date:     2012-02-06 10:46:12 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------
don't warn about non-text first responder, that does happen

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2012-02-06 07:35:11 UTC (rev 18491)
+++ trunk/bibdesk/BDSKEditor.m  2012-02-06 10:46:12 UTC (rev 18492)
@@ -337,21 +337,22 @@
 
 - (void)discardEditing
 {
+    id firstResponder = [[self window] firstResponder];
     // check textviews first
-    if (currentEditedView == [[self window] firstResponder]) {
+    if (currentEditedView == firstResponder) {
         // need some reasonable state for annote et al. textviews
         NSParameterAssert(nil != previousValueForCurrentEditedView);
         [currentEditedView setString:previousValueForCurrentEditedView];
     }
     // now handle any field editor(s)
-    else if ([[[self window] firstResponder] isKindOfClass:[NSText class]]) {
+    else if ([firstResponder isKindOfClass:[NSText class]]) {
      
         /*
          Omit the standard check for [[self window] fieldEditor:NO 
forObject:nil],
          since that returns nil for the tableview's field editor.
          */
         
-        NSControl *control = (NSControl *)[(NSText *)[[self window] 
firstResponder] delegate];
+        NSControl *control = (NSControl *)[(NSText *)firstResponder delegate];
         
         // may be self, if a textview was being edited (but we should have 
taken the first branch in that case)
         if ([control respondsToSelector:@selector(abortEditing)]) {
@@ -361,10 +362,6 @@
             fprintf(stderr, "%s, control does not respond to abortEditing\n", 
__func__);
         }
     }
-    else {
-        // should never happen
-        fprintf(stderr, "%s, unhandled firstResponder = %s\n", __func__, 
[[[[[self window] firstResponder] class] description] UTF8String]);
-    }
     if (editorFlags.isEditing) {
         [[self document] objectDidEndEditing:self];
         editorFlags.isEditing = NO;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to