Revision: 18474
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18474&view=rev
Author:   hofman
Date:     2012-02-03 10:38:30 +0000 (Fri, 03 Feb 2012)
Log Message:
-----------
do only warn for bibtex string parsing errors

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

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2012-02-03 07:34:29 UTC (rev 18473)
+++ trunk/bibdesk/BibDocument.m 2012-02-03 10:38:30 UTC (rev 18474)
@@ -2110,28 +2110,29 @@
     NSError *error = nil;
     NSArray *newPubs = [BDSKStringParser itemsFromString:string ofType:type 
owner:self error:&error];
     
-       if([error isLocalError] && [error code] == kBDSKBibTeXParserFailed) {
-        NSInteger rv = NSAlertDefaultReturn;
-        if (verbose) {
-            // this was BibTeX, but the user may want to try going with 
partial data
-            // run a modal dialog asking if we want to use partial data or 
give up
-            NSAlert *alert = [NSAlert 
alertWithMessageText:NSLocalizedString(@"Error Reading String", @"Message in 
alert dialog when failing to parse dropped or copied string")
-                                             
defaultButton:NSLocalizedString(@"Cancel", @"Button title")
-                                           
alternateButton:NSLocalizedString(@"Edit data", @"Button title")
-                                               
otherButton:NSLocalizedString(@"Keep going", @"Button title")
-                                 
informativeTextWithFormat:NSLocalizedString(@"There was a problem inserting the 
data. Do you want to ignore this data, open a window containing the data to 
edit it and remove the errors, or keep going and use everything that BibDesk 
could parse?\n(It's likely that choosing \"Keep Going\" will lose some data.)", 
@"Informative text in alert dialog")];
-            rv = [alert runModal];
+       if ([error isLocalError]) {
+        if ([error code] == kBDSKBibTeXParserFailed) {
+            NSInteger rv = NSAlertDefaultReturn;
+            if (verbose) {
+                // this was BibTeX, but the user may want to try going with 
partial data
+                // run a modal dialog asking if we want to use partial data or 
give up
+                NSAlert *alert = [NSAlert 
alertWithMessageText:NSLocalizedString(@"Error Reading String", @"Message in 
alert dialog when failing to parse dropped or copied string")
+                                                 
defaultButton:NSLocalizedString(@"Cancel", @"Button title")
+                                               
alternateButton:NSLocalizedString(@"Edit data", @"Button title")
+                                                   
otherButton:NSLocalizedString(@"Keep going", @"Button title")
+                                     
informativeTextWithFormat:NSLocalizedString(@"There was a problem inserting the 
data. Do you want to ignore this data, open a window containing the data to 
edit it and remove the errors, or keep going and use everything that BibDesk 
could parse?\n(It's likely that choosing \"Keep Going\" will lose some data.)", 
@"Informative text in alert dialog")];
+                rv = [alert runModal];
+            }
+            if(rv == NSAlertAlternateReturn)
+                [[BDSKErrorObjectController sharedErrorObjectController] 
showEditorForLastPasteDragError];
+            if (rv != NSAlertOtherReturn)
+                newPubs = nil;
+        } else if ([error code] == kBDSKParserIgnoredFrontMatter) {
+            // here we want to display an alert, but don't propagate a 
nil/error back up, since it's not a failure
+            if (verbose)
+                [self presentError:error];
+            error = nil;
         }
-        if(rv == NSAlertAlternateReturn)
-            [[BDSKErrorObjectController sharedErrorObjectController] 
showEditorForLastPasteDragError];
-        if (rv != NSAlertOtherReturn)
-            newPubs = nil;
-       }else if(error){
-        if (verbose && ([error isLocalError] == NO || [error code] != 
kBDSKHadMissingCiteKeys))
-            [self presentError:error];
-        // here we want to display an alert, but don't propagate a nil/error 
back up, since it's not a failure
-        if ([error isLocalError] && [error code] == 
kBDSKParserIgnoredFrontMatter)
-            error = nil;
     }
     
        if(outError) *outError = error;

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