Revision: 12361
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12361&view=rev
Author:   hofman
Date:     2008-01-08 08:15:45 -0800 (Tue, 08 Jan 2008)

Log Message:
-----------
Avoid exceptions from text import. Set owner of the item to nil before 
resetting the item. Remove the item before closing. Should fix bug # 1866532.

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

Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m    2008-01-08 15:58:32 UTC (rev 
12360)
+++ trunk/bibdesk/BDSKTextImportController.m    2008-01-08 16:15:45 UTC (rev 
12361)
@@ -279,11 +279,13 @@
         if ([files count])
             [[BDSKFiler sharedFiler] filePapers:files fromDocument:document 
check:NO];
     }
+    
+    [[self undoManager] removeAllActions];
+    [item setOwner:nil];
     [item release];
     
     item = newItem;
     [item setOwner:self];
-    [[self undoManager] removeAllActions];
        
        int numItems = [itemsAdded count];
        NSString *pubSingularPlural = (numItems == 1) ? 
NSLocalizedString(@"publication", @"publication, in status message") : 
NSLocalizedString(@"publications", @"publications, in status message");
@@ -298,6 +300,10 @@
 - (IBAction)closeAction:(id)sender{
     // make the tableview stop editing:
     [self finalizeChangesPreservingSelection:NO];
+    [[self undoManager] removeAllActions];
+    [item setOwner:nil];
+    [item release];
+    item = nil;
     [super dismiss:sender];
 }
 
@@ -307,10 +313,11 @@
 }
 
 - (IBAction)clearAction:(id)sender{
+    [[self undoManager] removeAllActions];
+    [item setOwner:nil];
     [item release];
     item = [[BibItem alloc] init];
     [item setOwner:self];
-    [[self undoManager] removeAllActions];
     
     [itemTypeButton selectItemWithTitle:[item pubType]];
     [citeKeyField setStringValue:[item citeKey]];


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to