Revision: 29290
          http://sourceforge.net/p/bibdesk/svn/29290
Author:   hofman
Date:     2025-07-18 09:07:53 +0000 (Fri, 18 Jul 2025)
Log Message:
-----------
no need to validate edited text view in commitEing as it is done implicitly in 
textShouldEndEditing: when changing the first responder

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

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2025-07-17 22:28:30 UTC (rev 29289)
+++ trunk/bibdesk/BDSKEditor.m  2025-07-18 09:07:53 UTC (rev 29290)
@@ -359,16 +359,6 @@
     return rv;
 }
 
-- (BOOL)validateCurrentEditedView
-{
-    NSParameterAssert(currentEditedView);
-    NSError *error = nil;
-    BOOL rv = [self validateCurrentEditedViewAndReturnError:&error];
-    if (NO == rv && error)
-        [self presentError:error modalForWindow:[self window] delegate:nil 
didPresentSelector:NULL contextInfo:NULL];
-    return rv;
-}
-
 - (void)discardEditing
 {
     if (editorFlags.isEditing == NO)
@@ -432,10 +422,6 @@
         
         editorFlags.didSetupFields = NO; // if we we rebuild the fields, the 
selection will become meaningless
         
-        // check textviews for balanced braces as needed
-        if (currentEditedView && [self validateCurrentEditedView] == NO)
-            return NO;
-        
         // commit edits (formatters may refuse to allow this)
         if ([[self window] makeFirstResponder:[self window]] == NO)
             return NO;
@@ -2289,9 +2275,14 @@
 
 - (BOOL)textShouldEndEditing:(NSText *)aTextObject {
     BDSKASSERT(aTextObject == currentEditedView);
-    if (aTextObject == currentEditedView)
-        return [self validateCurrentEditedView];
-    return YES;
+    BOOL isValid = YES;
+    if (aTextObject == currentEditedView) {
+        NSError *error = nil;
+        isValid = [self validateCurrentEditedViewAndReturnError:&error];
+        if (NO == isValid && error)
+            [self presentError:error modalForWindow:[self window] delegate:nil 
didPresentSelector:NULL contextInfo:NULL];
+    }
+    return isValid;
 }
 
 // sent by the textViews

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to