Revision: 28558
          http://sourceforge.net/p/bibdesk/svn/28558
Author:   hofman
Date:     2024-01-06 17:53:06 +0000 (Sat, 06 Jan 2024)
Log Message:
-----------
Add some bridgings. Import some headers. Avoid some autorelease. Declare some 
__unsafe_unretained. Avoid passing object by reference.

Modified Paths:
--------------
    trunk/bibdesk/BDSKACLParser.m
    trunk/bibdesk/BDSKBibTeXParser.m
    trunk/bibdesk/BDSKComplexString.m
    trunk/bibdesk/BDSKConverter.m
    trunk/bibdesk/BDSKDBLPGroupServer.m
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BDSKExternalGroup.m
    trunk/bibdesk/BDSKFieldCollection.m
    trunk/bibdesk/BDSKFileSearchIndex.m
    trunk/bibdesk/BDSKFilterController.m
    trunk/bibdesk/BDSKGroup.m
    trunk/bibdesk/BDSKGroupOutlineView.m
    trunk/bibdesk/BDSKGroupsArray.m
    trunk/bibdesk/BDSKISIGroupServer.m
    trunk/bibdesk/BDSKItemSearchIndexes.m
    trunk/bibdesk/BDSKLibraryGroup.m
    trunk/bibdesk/BDSKLineNumberView.m
    trunk/bibdesk/BDSKLinkedFile.m
    trunk/bibdesk/BDSKMODSParser.m
    trunk/bibdesk/BDSKMacroResolver.m
    trunk/bibdesk/BDSKMacroWindowController.m
    trunk/bibdesk/BDSKOrphanedFilesFinder.m
    trunk/bibdesk/BDSKPublicationsArray.m
    trunk/bibdesk/BDSKScriptGroup.m
    trunk/bibdesk/BDSKSearchForCommand.m
    trunk/bibdesk/BDSKSearchGroupViewController.m
    trunk/bibdesk/BDSKServiceProvider.m
    trunk/bibdesk/BDSKSharingBrowser.m
    trunk/bibdesk/BDSKSharingServer.m
    trunk/bibdesk/BDSKSmartGroup.m
    trunk/bibdesk/BDSKStatusBar.m
    trunk/bibdesk/BDSKTask.m
    trunk/bibdesk/BDSKTemplateParser.m
    trunk/bibdesk/BDSKURLGroup.m
    trunk/bibdesk/BDSKWebGroup.m
    trunk/bibdesk/BDSKWebGroupViewController.h
    trunk/bibdesk/BDSKZoomGroupServer.m
    trunk/bibdesk/BibAuthor+Scripting.m
    trunk/bibdesk/BibAuthor.m
    trunk/bibdesk/BibDocument+Scripting.m
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/BibDocument_Actions.m
    trunk/bibdesk/BibDocument_DataSource.m
    trunk/bibdesk/BibDocument_Groups.m
    trunk/bibdesk/BibDocument_Menus.m
    trunk/bibdesk/BibDocument_UI.m
    trunk/bibdesk/BibItem.m
    trunk/bibdesk/Bibdesk_Prefix.pch
    trunk/bibdesk/NSAppleEventDescriptor_BDSKExtensions.m
    trunk/bibdesk/NSAttributedString_BDSKExtensions.m
    trunk/bibdesk/NSPasteboard_BDSKExtensions.m
    trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m
    trunk/bibdesk/NSString_BDSKExtensions.h
    trunk/bibdesk/NSString_BDSKExtensions.m
    trunk/bibdesk/NSURL_BDSKExtensions.m

Modified: trunk/bibdesk/BDSKACLParser.m
===================================================================
--- trunk/bibdesk/BDSKACLParser.m       2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKACLParser.m       2024-01-06 17:53:06 UTC (rev 28558)
@@ -61,16 +61,16 @@
 - (void)addPDFURLsToItems:(NSArray *)bibtexItems {
     if ([bibtexItems count] > 0) {
         for (BibItem *item in bibtexItems) {
-            NSString *url = [item valueOfField:BDSKUrlString];
+            NSString *url = [[item valueOfField:BDSKUrlString] retain];
             if ([NSString isEmptyString:url] == NO) {
                 if ([[url pathExtension] isCaseInsensitiveEqual:@"pdf"] == NO) 
{
                     NSString *pdfURL = [([url hasSuffix:@"/"] ? [url 
substringToIndex:[url length] - 1] : url) stringByAppendingString:@".pdf"];
-                    [[url retain] autorelease];
                     [item setField:BDSKUrlString toValue:pdfURL];
                     [item addURLString:pdfURL];
                 }
                 [item addURLString:url];
             }
+            [url release];
         }
     }
 }

Modified: trunk/bibdesk/BDSKBibTeXParser.m
===================================================================
--- trunk/bibdesk/BDSKBibTeXParser.m    2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKBibTeXParser.m    2024-01-06 17:53:06 UTC (rev 28558)
@@ -671,11 +671,11 @@
          if(CFStringGetCString(cfName, buffer, requiredLength, encoding)){
              name_cstring = buffer;
          } else {
-             [NSException raise:NSInternalInconsistencyException 
format:@"Unable to convert string %@ to encoding %@", (__bridge id)aName, 
CFStringGetNameOfEncoding(encoding)];
+             [NSException raise:NSInternalInconsistencyException 
format:@"Unable to convert string %@ to encoding %@", aName, 
CFStringGetNameOfEncoding(encoding)];
              // this would work, but we shouldn't need a fallback to a 
fallback...
              CFAllocatorDeallocate(alloc, buffer);
              shouldFree = NO;
-             name_cstring = [(__bridge NSString *)aName UTF8String];
+             name_cstring = [aName UTF8String];
              encoding = kCFStringEncodingUTF8;
          }
     }

Modified: trunk/bibdesk/BDSKComplexString.m
===================================================================
--- trunk/bibdesk/BDSKComplexString.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKComplexString.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -358,11 +358,7 @@
 }
 
 - (id)copyWithZone:(NSZone *)zone{
-    if (NSShouldRetainWithZone(self, zone))
-        return [self retain];
-    else
-        return [[BDSKComplexString alloc] initWithNodes:nodes 
macroResolver:macroResolver isComplex:isComplex isInherited:isInherited];
-
+    return [self retain];
 }
 
 /* NSCoding protocol */

Modified: trunk/bibdesk/BDSKConverter.m
===================================================================
--- trunk/bibdesk/BDSKConverter.m       2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKConverter.m       2024-01-06 17:53:06 UTC (rev 28558)
@@ -218,13 +218,12 @@
     else if (decomposedLength > 2 || [accentCharSet 
characterIsMember:[charString characterAtIndex:1]] == NO)
         return NO;
     
-    CFAllocatorRef alloc = CFGetAllocator(charString);
     // isolate accent
-    NSString *accentChar = 
CFBridgingRelease(CFStringCreateWithSubstring(alloc, (__bridge 
CFStringRef)charString, CFRangeMake(1, 1)));
+    NSString *accentChar = 
CFBridgingRelease(CFStringCreateWithSubstring(kCFAllocatorDefault, (__bridge 
CFStringRef)charString, CFRangeMake(1, 1)));
     NSString *accent = [texifyAccents objectForKey:accentChar];
     
     // isolate character
-    NSString *character = CFBridgingRelease(CFStringCreateWithSubstring(alloc, 
(__bridge CFStringRef)charString, CFRangeMake(0, 1)));
+    NSString *character = 
CFBridgingRelease(CFStringCreateWithSubstring(kCFAllocatorDefault, (__bridge 
CFStringRef)charString, CFRangeMake(0, 1)));
     
     // handle i and j (others as well?)
     if (([character isEqualToString:@"i"] || [character isEqualToString:@"j"]) 
&&
@@ -348,8 +347,7 @@
         // scan up to the closing brace, since we don't know the character 
substring length beforehand
         if (ch == '}') {
 
-            CFAllocatorRef alloc = CFGetAllocator(texString);
-            character = CFBridgingRelease(CFStringCreateWithSubstring(alloc, 
(__bridge CFStringRef)texString, CFRangeMake(letterStart, idx - letterStart)));
+            character = 
CFBridgingRelease(CFStringCreateWithSubstring(kCFAllocatorDefault, (__bridge 
CFStringRef)texString, CFRangeMake(letterStart, idx - letterStart)));
             
             // special cases for old style i, j
             if ([character isEqualToString:@"\\i"]) {
@@ -359,7 +357,7 @@
             }
             
             if ([character length] == 1) {
-                CFMutableStringRef mutableCharacter = 
CFStringCreateMutableCopy(alloc, 0, (__bridge CFStringRef)character);
+                CFMutableStringRef mutableCharacter = 
CFStringCreateMutableCopy(kCFAllocatorDefault, 0, (__bridge 
CFStringRef)character);
                 CFStringAppend(mutableCharacter, (__bridge CFStringRef)accent);
                 CFStringNormalize(mutableCharacter, 
kCFStringNormalizationFormC);
                 

Modified: trunk/bibdesk/BDSKDBLPGroupServer.m
===================================================================
--- trunk/bibdesk/BDSKDBLPGroupServer.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKDBLPGroupServer.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -313,11 +313,11 @@
         return;
     }
     
-    [[download retain] autorelease];
-    [downloads removeObject:download];
+    BDSKDownload *oldDownload = [download retain];
+    [downloads removeObject:oldDownload];
     
-    NSData *data = [download data];
-    NSURLResponse *response = [download response];
+    NSData *data = [oldDownload data];
+    NSURLResponse *response = [oldDownload response];
     
     if ([response respondsToSelector:@selector(statusCode)] && 
[(NSHTTPURLResponse *)response statusCode] == 429) {
         [downloads makeObjectsPerformSelector:@selector(cancel)];
@@ -358,7 +358,7 @@
         
         BOOL isBibTeX = NO;
         NSArray *pubs = nil;
-        NSUInteger i = [bibtexFetches indexOfObject:download];
+        NSUInteger i = [bibtexFetches indexOfObject:oldDownload];
         
         if (i != NSNotFound) {
             isBibTeX = YES;
@@ -370,7 +370,7 @@
             pubs = [BDSKBibTeXParser itemsFromString:btString owner:group 
error:NULL];
             [bibtexFetches replaceObjectAtIndex:i withObject:pubs];
         } else {
-            i = [xmlFetches indexOfObject:download];
+            i = [xmlFetches indexOfObject:oldDownload];
             if (i != NSNotFound) {
                 NSXMLDocument *xmlDoc = [[[NSXMLDocument alloc] 
initWithData:data options:NSXMLDocumentTidyXML error:NULL] autorelease];
                 NSDictionary *urlsForKeys = [self urlsFromXMLDocument:xmlDoc];
@@ -394,6 +394,7 @@
             [group addPublications:pubs];
         }
     }
+    [oldDownload release];
 }
 
 - (NSWindow *)downloadWindowForAuthenticationSheet:(BDSKDownload *)download {

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKEditor.m  2024-01-06 17:53:06 UTC (rev 28558)
@@ -2099,17 +2099,16 @@
 }
 
 - (void)recordChangingField:(NSString *)fieldName toValue:(NSString *)value{
+    NSString *theField = [[fieldName retain] autorelease];
     NSString *oldValue = [[[publication valueOfField:fieldName] copy] 
autorelease];
     
-    [[fieldName retain] autorelease];
-    
-    [publication setField:fieldName toValue:value];
+    [publication setField:theField toValue:value];
        
        [[self undoManager] setActionName:NSLocalizedString(@"Edit 
Publication", @"Undo action name")];
     
-    [self userChangedField:fieldName from:oldValue to:value];
+    [self userChangedField:theField from:oldValue to:value];
     
-    if ([fieldName isEqualToString:BDSKLocalUrlString] && [[NSUserDefaults 
standardUserDefaults] boolForKey:BDSKUseLocalUrlAndUrlKey] && [[NSUserDefaults 
standardUserDefaults] boolForKey:BDSKFilePapersAutomaticallyKey]) {
+    if ([theField isEqualToString:BDSKLocalUrlString] && [[NSUserDefaults 
standardUserDefaults] boolForKey:BDSKUseLocalUrlAndUrlKey] && [[NSUserDefaults 
standardUserDefaults] boolForKey:BDSKFilePapersAutomaticallyKey]) {
         if ([publication autoFileLocalUrl])
             [self setStatus:NSLocalizedString(@"Autofiled linked 
file.",@"Status message")];
     }

Modified: trunk/bibdesk/BDSKExternalGroup.m
===================================================================
--- trunk/bibdesk/BDSKExternalGroup.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKExternalGroup.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -41,6 +41,7 @@
 #import "BibItem.h"
 #import "BDSKPublicationsArray.h"
 #import "BDSKMacroResolver.h"
+#import "BibDocument.h"
 #import "NSArray_BDSKExtensions.h"
 
 NSString *BDSKExternalGroupPublicationsKey = @"publications";

Modified: trunk/bibdesk/BDSKFieldCollection.m
===================================================================
--- trunk/bibdesk/BDSKFieldCollection.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKFieldCollection.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -155,7 +155,7 @@
     return self;
 }
 
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state 
objects:(id *)stackbuf count:(NSUInteger)len {
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState 
__unsafe_unretained *)state objects:(id *)stackbuf count:(NSUInteger)len {
     NSUInteger i, current, count = [fieldNames count];
     for (i = 0, current = state->state; current < count && i < len; i++, 
current++)
         stackbuf[i] = [fieldCollection fieldForName:[fieldNames 
objectAtIndex:current]];

Modified: trunk/bibdesk/BDSKFileSearchIndex.m
===================================================================
--- trunk/bibdesk/BDSKFileSearchIndex.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKFileSearchIndex.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -43,6 +43,7 @@
 #import "NSData_BDSKExtensions.h"
 #import "NSArray_BDSKExtensions.h"
 #import "BDSKReadWriteLock.h"
+#import "BDSKPublicationsArray.h"
 
 #define BDSKDisableFileSearchIndexCacheKey 
@"BDSKDisableFileSearchIndexCacheKey"
 
@@ -285,7 +286,7 @@
         NSMutableData *data = [NSMutableData data];
         NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] 
initForWritingWithMutableData:data];
         [archiver encodeObject:documentURL forKey:@"documentURL"];
-        [archiver encodeObject:(NSMutableData *)indexData forKey:@"indexData"];
+        [archiver encodeObject:(__bridge NSMutableData *)indexData 
forKey:@"indexData"];
         [archiver encodeObject:signatures forKey:@"signatures"];
         [archiver finishEncoding];
         [archiver release];

Modified: trunk/bibdesk/BDSKFilterController.m
===================================================================
--- trunk/bibdesk/BDSKFilterController.m        2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKFilterController.m        2024-01-06 17:53:06 UTC (rev 
28558)
@@ -288,7 +288,8 @@
     if (delegate && didCommitSelector) {
         // - (void)editor:(id)editor didCommit:(BOOL)didCommit 
contextInfo:(void *)contextInfo
         NSInvocation *invocation = [NSInvocation invocationWithTarget:delegate 
selector:didCommitSelector];
-        [invocation setArgument:&self atIndex:2];
+        __unsafe_unretained id unretainedSelf = self;
+        [invocation setArgument:&unretainedSelf atIndex:2];
         [invocation setArgument:&didCommit atIndex:3];
         [invocation setArgument:&contextInfo atIndex:4];
         dispatch_async(dispatch_get_main_queue(), ^{ [invocation invoke]; });

Modified: trunk/bibdesk/BDSKGroup.m
===================================================================
--- trunk/bibdesk/BDSKGroup.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKGroup.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -45,6 +45,7 @@
 #import "BibDocument.h"
 #import "BDSKMacroResolver.h"
 #import "BDSKRuntime.h"
+#import "BDSKPublicationsArray.h"
 
 
 @implementation BDSKGroup

Modified: trunk/bibdesk/BDSKGroupOutlineView.m
===================================================================
--- trunk/bibdesk/BDSKGroupOutlineView.m        2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKGroupOutlineView.m        2024-01-06 17:53:06 UTC (rev 
28558)
@@ -171,7 +171,7 @@
         [countImage setTemplate:YES];
         if (countImages == nil)
             countImages = [[NSMapTable alloc] 
initWithKeyOptions:NSPointerFunctionsOpaqueMemory | 
NSPointerFunctionsIntegerPersonality 
valueOptions:NSPointerFunctionsStrongMemory | 
NSPointerFunctionsObjectPersonality capacity:0];
-        NSMapInsert(countImages, (__bridge const void *)count, countImage);
+        NSMapInsert(countImages, (const void *)count, (__bridge void 
*)countImage);
     }
     return countImage;
 }

Modified: trunk/bibdesk/BDSKGroupsArray.m
===================================================================
--- trunk/bibdesk/BDSKGroupsArray.m     2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKGroupsArray.m     2024-01-06 17:53:06 UTC (rev 28558)
@@ -119,7 +119,7 @@
     return [groups objectAtIndex:idx];
 }
 
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state 
objects:(id *)stackbuf count:(NSUInteger)len {
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state 
objects:(id __unsafe_unretained *)stackbuf count:(NSUInteger)len {
     return [groups countByEnumeratingWithState:state objects:stackbuf 
count:len];
 }
 

Modified: trunk/bibdesk/BDSKISIGroupServer.m
===================================================================
--- trunk/bibdesk/BDSKISIGroupServer.m  2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKISIGroupServer.m  2024-01-06 17:53:06 UTC (rev 28558)
@@ -351,7 +351,7 @@
 - (void)operation:(BDSKSoapBindingOperation *)anOperation 
completedWithResponse:(BDSKSoapBindingResponse *)response {
     
     // calling release may make the operation and response invalid
-    [operation autorelease];
+    [operation release];
     operation = nil;
     
     id result = nil;

Modified: trunk/bibdesk/BDSKItemSearchIndexes.m
===================================================================
--- trunk/bibdesk/BDSKItemSearchIndexes.m       2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKItemSearchIndexes.m       2024-01-06 17:53:06 UTC (rev 
28558)
@@ -98,7 +98,7 @@
             
             for (NSString *field in fields) {
                 NSString *searchText = [pub searchStringForField:field];
-                SKIndexRef skIndex = (void 
*)CFDictionaryGetValue(searchIndexes, field);
+                SKIndexRef skIndex = 
(SKIndexRef)CFDictionaryGetValue(searchIndexes, (__bridge void *)field);
                 if (searchText && skIndex)
                     SKIndexAddDocumentWithText(skIndex, doc, (__bridge 
CFStringRef)searchText, TRUE);
             }

Modified: trunk/bibdesk/BDSKLibraryGroup.m
===================================================================
--- trunk/bibdesk/BDSKLibraryGroup.m    2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKLibraryGroup.m    2024-01-06 17:53:06 UTC (rev 28558)
@@ -38,6 +38,8 @@
 
 #import "BDSKLibraryGroup.h"
 #import "NSImage_BDSKExtensions.h"
+#import "BibItem.h"
+#import "BibDocument.h"
 
 
 @implementation BDSKLibraryGroup

Modified: trunk/bibdesk/BDSKLineNumberView.m
===================================================================
--- trunk/bibdesk/BDSKLineNumberView.m  2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKLineNumberView.m  2024-01-06 17:53:06 UTC (rev 28558)
@@ -118,7 +118,7 @@
         if (line > 0) {
             if (errorMarkers == nil)
                 errorMarkers = [[NSMapTable alloc] 
initWithKeyOptions:NSPointerFunctionsOpaqueMemory | 
NSPointerFunctionsIntegerPersonality 
valueOptions:NSPointerFunctionsStrongMemory | 
NSPointerFunctionsObjectPersonality capacity:0];
-            NSMapInsert(errorMarkers, (const void *)(line - 1), (__bridge 
id)marker);
+            NSMapInsert(errorMarkers, (const void *)(line - 1), (__bridge void 
*)marker);
         }
     }
 }

Modified: trunk/bibdesk/BDSKLinkedFile.m
===================================================================
--- trunk/bibdesk/BDSKLinkedFile.m      2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKLinkedFile.m      2024-01-06 17:53:06 UTC (rev 28558)
@@ -458,9 +458,9 @@
                 anAlias = [alias retain];
         }
     }
-    self = [[[self class] alloc] initWithAlias:anAlias 
relativePath:relativePath delegate:nil];
+    id copy = [[[self class] alloc] initWithAlias:anAlias 
relativePath:relativePath delegate:nil];
     [anAlias release];
-    return self;
+    return copy;
 }
 
 // Should we implement -isEqual: and -hash?
@@ -603,9 +603,6 @@
         if (newRef) {
             bcopy(aRef, newRef, sizeof(FSRef));
             fileRef = newRef;
-        } else {
-            [self release];
-            self = nil;
         }
     }
 }
@@ -1123,7 +1120,7 @@
         return nil;
     // bookmark data before 10.12 was very large, hopefully that will be 
better when saving a minimal bookmark
     // for newer OS versions minimal bookmarks do not seem to be smaller, 
sometimnes even larger
-    return CFBridgingRelease(CFURLCreateBookmarkData(kCFAllocatorDefault, 
(CFURLRef)aURL, 0, NULL, NULL, NULL));
+    return CFBridgingRelease(CFURLCreateBookmarkData(kCFAllocatorDefault, 
(__bridge CFURLRef)aURL, 0, NULL, NULL, NULL));
 }
 
 static NSDictionary *BDSKDictionaryFromPlistData(NSData *data) {

Modified: trunk/bibdesk/BDSKMODSParser.m
===================================================================
--- trunk/bibdesk/BDSKMODSParser.m      2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKMODSParser.m      2024-01-06 17:53:06 UTC (rev 28558)
@@ -63,12 +63,11 @@
     if (nil == itemString)
         return @[];
     
-    NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:itemString 
options:0 error:outError];
+    NSXMLDocument *doc = [[[NSXMLDocument alloc] initWithXMLString:itemString 
options:0 error:outError] autorelease];
     if (nil == doc)
         return @[];
     
     NSXMLDocument *marcDoc = [doc objectByApplyingXSLT:MODSToMARCXSLTData 
arguments:nil error:outError];
-    [doc autorelease];
     if (nil == marcDoc)
         return @[];
     

Modified: trunk/bibdesk/BDSKMacroResolver.m
===================================================================
--- trunk/bibdesk/BDSKMacroResolver.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKMacroResolver.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -308,12 +308,11 @@
         if ([[[formatter calendar] calendarIdentifier] 
isEqualToString:NSCalendarIdentifierGregorian] == NO)
             [formatter setCalendar:[[[NSCalendar alloc] 
initWithCalendarIdentifier:NSCalendarIdentifierGregorian] autorelease]];
         NSString *shortMonthNames[12] = {@"jan", @"feb", @"mar", @"apr", 
@"may", @"jun", @"jul", @"aug", @"sep", @"oct", @"nov", @"dec"};
-        NSString *monthNames[12];
-        [[formatter standaloneMonthSymbols] getObjects:monthNames 
range:NSMakeRange(0, 12)];
+        NSArray *monthNames = [formatter standaloneMonthSymbols];
         standardMacroDefinitions = [[NSMapTable alloc] 
initWithKeyPointerFunctions:[NSPointerFunctions 
caseInsensitiveStringPointerFunctions] 
valuePointerFunctions:[NSPointerFunctions 
pointerFunctionsWithOptions:NSPointerFunctionsStrongMemory | 
NSPointerFunctionsObjectPersonality] capacity:0];
         NSUInteger i;
         for (i = 0; i < 12; i++)
-            [standardMacroDefinitions setObject:monthNames[i] 
forKey:shortMonthNames[i]];
+            [standardMacroDefinitions setObject:[monthNames objectAtIndex:i] 
forKey:shortMonthNames[i]];
         // these need to be loaded lazily, because loading them can use 
ourselves, but we aren't yet initialized
         fileMacroDefinitions = nil; 
                

Modified: trunk/bibdesk/BDSKMacroWindowController.m
===================================================================
--- trunk/bibdesk/BDSKMacroWindowController.m   2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKMacroWindowController.m   2024-01-06 17:53:06 UTC (rev 
28558)
@@ -55,6 +55,7 @@
 #import "NSPasteboard_BDSKExtensions.h"
 #import "BDSKTypeManager.h"
 #import "BDSKTouchBarButtonGroup.h"
+#import "BDSKPublicationsArray.h"
 
 #define BDSKMacroWindowFrameAutosaveName @"BDSKMacroWindow"
 

Modified: trunk/bibdesk/BDSKOrphanedFilesFinder.m
===================================================================
--- trunk/bibdesk/BDSKOrphanedFilesFinder.m     2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKOrphanedFilesFinder.m     2024-01-06 17:53:06 UTC (rev 
28558)
@@ -59,6 +59,7 @@
 #import "BDSKFileImageTransformer.h"
 #import "BDSKFilePathTransformer.h"
 #import "BDSKLinkedFile.h"
+#import "BDSKPublicationsArray.h"
 
 #define BDSKOrphanedFilesWindowFrameAutosaveName @"BDSKOrphanedFilesWindow"
 

Modified: trunk/bibdesk/BDSKPublicationsArray.m
===================================================================
--- trunk/bibdesk/BDSKPublicationsArray.m       2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKPublicationsArray.m       2024-01-06 17:53:06 UTC (rev 
28558)
@@ -215,11 +215,11 @@
 
 #pragma mark Convenience overrides
 
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state 
objects:(id *)stackbuf count:(NSUInteger)len {
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state 
objects:(id __unsafe_unretained *)stackbuf count:(NSUInteger)len {
     return [publications countByEnumeratingWithState:state objects:stackbuf 
count:len];
 }
 
-- (void)getObjects:(id *)aBuffer range:(NSRange)aRange;
+- (void)getObjects:(id __unsafe_unretained *)aBuffer range:(NSRange)aRange;
 {
     [publications getObjects:aBuffer range:aRange];
 }
@@ -380,7 +380,7 @@
     CFAllocatorRef alloc = CFAllocatorGetDefault();
     for(i = idx, fileOrder = idx + 1; i < count; i++, fileOrder++) {
         CFNumberRef n = CFNumberCreate(alloc, kCFNumberNSIntegerType, 
&fileOrder);
-        [[publications objectAtIndex:i] setFileOrder:(NSNumber *)n];
+        [[publications objectAtIndex:i] setFileOrder:(__bridge NSNumber *)n];
         CFRelease(n);
     }
 }

Modified: trunk/bibdesk/BDSKScriptGroup.m
===================================================================
--- trunk/bibdesk/BDSKScriptGroup.m     2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKScriptGroup.m     2024-01-06 17:53:06 UTC (rev 28558)
@@ -357,10 +357,9 @@
     NSFileHandle *outputFileHandle = [[currentTask standardOutput] 
fileHandleForReading];
     [nc removeObserver:self 
name:NSFileHandleReadToEndOfFileCompletionNotification object:outputFileHandle];
     
-    NSString *outputString = [[NSString alloc] initWithData:stdoutData 
encoding:NSUTF8StringEncoding];
+    NSString *outputString = [[[NSString alloc] initWithData:stdoutData 
encoding:NSUTF8StringEncoding] autorelease];
     if(outputString == nil)
-        outputString = [[NSString alloc] initWithData:stdoutData 
encoding:[NSString defaultCStringEncoding]];
-    [outputString autorelease];
+        outputString = [[[NSString alloc] initWithData:stdoutData 
encoding:[NSString defaultCStringEncoding]] autorelease];
     
     NSInteger terminationStatus = [currentTask terminationStatus];
     
@@ -384,7 +383,7 @@
 - (void)runShellScript;
 {    
     if (stdoutData) {
-        [stdoutData autorelease];
+        [stdoutData release];
         stdoutData = nil;
     }
     

Modified: trunk/bibdesk/BDSKSearchForCommand.m
===================================================================
--- trunk/bibdesk/BDSKSearchForCommand.m        2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKSearchForCommand.m        2024-01-06 17:53:06 UTC (rev 
28558)
@@ -40,6 +40,7 @@
 #import "BibAuthor.h"
 #import "BibItem.h"
 #import "BibDocument.h"
+#import "BDSKPublicationsArray.h"
 
 
 @interface BibItem (Finding)

Modified: trunk/bibdesk/BDSKSearchGroupViewController.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroupViewController.m       2024-01-05 23:20:24 UTC 
(rev 28557)
+++ trunk/bibdesk/BDSKSearchGroupViewController.m       2024-01-06 17:53:06 UTC 
(rev 28558)
@@ -38,6 +38,7 @@
 
 #import "BDSKSearchGroupViewController.h"
 #import "BDSKSearchGroup.h"
+#import "BDSKServerInfo.h"
 #import "BDSKEdgeView.h"
 
 

Modified: trunk/bibdesk/BDSKServiceProvider.m
===================================================================
--- trunk/bibdesk/BDSKServiceProvider.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKServiceProvider.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -47,6 +47,7 @@
 #import "BDSKDocumentController.h"
 #import "NSURL_BDSKExtensions.h"
 #import "NSPasteboard_BDSKExtensions.h"
+#import "BDSKPublicationsArray.h"
 
 
 @implementation BDSKServiceProvider

Modified: trunk/bibdesk/BDSKSharingBrowser.m
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.m  2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKSharingBrowser.m  2024-01-06 17:53:06 UTC (rev 28558)
@@ -129,11 +129,13 @@
                 // we're not sharing, so it can't be ours
                 break;
             case BDSKSharingStatusPublishing:
+            {
                 // we may be sharing, but it may still find a name collision, 
so check again after a second
                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC), 
dispatch_get_main_queue(), ^{
                     [self resolveService:aNetService];
                 });
                 return;
+            }
             case BDSKSharingStatusSharing:
                 // yes, it's our own service, ignore
                 [undecidedNetServices removeObject:aNetService];

Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKSharingServer.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -78,9 +78,6 @@
 NSString *BDSKServiceNameForKeychain = @"BibDesk Sharing";
 
 static SCDynamicStoreRef dynamicStore = NULL;
-static const void *retainCallBack(const void *info) { return [(id)info 
retain]; }
-static void releaseCallBack(const void *info) { [(id)info release]; }
-static CFStringRef copyDescriptionCallBack(const void *info) { return 
(CFStringRef)[[(id)info description] copy]; }
 // convert this to an NSNotification
 static void SCDynamicStoreChanged(SCDynamicStoreRef store, CFArrayRef 
changedKeys, void *info)
 {
@@ -171,10 +168,10 @@
     CFRetain(alloc); // make sure this is maintained for the life of the 
program
     SCDynamicStoreContext SCNSObjectContext = {
         0,                         // version
-        (id)nil,                   // any NSCF type
-        &retainCallBack,
-        &releaseCallBack,
-        &copyDescriptionCallBack
+        NULL,                   // any NSCF type
+        NULL,
+        NULL,
+        NULL
     };
     CFBundleRef mainBundle = CFBundleGetMainBundle();
     if (NULL == mainBundle) {
@@ -204,7 +201,7 @@
 
 + (NSString *)defaultSharingName;
 {
-    return [(id)SCDynamicStoreCopyComputerName(dynamicStore, NULL) 
autorelease];
+    return CFBridgingRelease(SCDynamicStoreCopyComputerName(dynamicStore, 
NULL));
 }
 
 // base name for sharing (also used for storing remote host names in keychain)

Modified: trunk/bibdesk/BDSKSmartGroup.m
===================================================================
--- trunk/bibdesk/BDSKSmartGroup.m      2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKSmartGroup.m      2024-01-06 17:53:06 UTC (rev 28558)
@@ -41,6 +41,8 @@
 #import "NSImage_BDSKExtensions.h"
 #import "BibItem.h"
 #import "BDSKCondition.h"
+#import "BibDocument.h"
+#import "BDSKPublicationsArray.h"
 
 
 @implementation BDSKSmartGroup

Modified: trunk/bibdesk/BDSKStatusBar.m
===================================================================
--- trunk/bibdesk/BDSKStatusBar.m       2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKStatusBar.m       2024-01-06 17:53:06 UTC (rev 28558)
@@ -360,10 +360,10 @@
         return [textField stringValue];
     
     if ([delegate 
respondsToSelector:@selector(statusBar:toolTipForIdentifier:)])
-               return [delegate statusBar:self toolTipForIdentifier:(NSString 
*)userData];
+               return [delegate statusBar:self toolTipForIdentifier:(__bridge 
NSString *)userData];
        
        for (BDSKStatusBarIcon *icon in icons) {
-               if ([[icon identifier] isEqualToString:(NSString *)userData]) {
+               if ([[icon identifier] isEqualToString:(__bridge NSString 
*)userData]) {
                        return [icon toolTip];
                }
        }

Modified: trunk/bibdesk/BDSKTask.m
===================================================================
--- trunk/bibdesk/BDSKTask.m    2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKTask.m    2024-01-06 17:53:06 UTC (rev 28558)
@@ -182,7 +182,7 @@
 static void __BDSKTaskNotify(void *info)
 {
     // note: we have a hard retain at this point, so -dealloc and 
_disableNotification can't be called
-    BDSKTask *task = info;    
+    BDSKTask *task = (__bridge BDSKTask *)info;    
     [[NSNotificationCenter defaultCenter] 
postNotificationName:NSTaskDidTerminateNotification object:task];    
     
     pthread_mutex_lock(&task->_internal->_lock);

Modified: trunk/bibdesk/BDSKTemplateParser.m
===================================================================
--- trunk/bibdesk/BDSKTemplateParser.m  2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKTemplateParser.m  2024-01-06 17:53:06 UTC (rev 28558)
@@ -101,13 +101,11 @@
     invertedKeyCharacterSet = [[keyCharacterSet invertedSet] copy];
 }
 
-static inline NSString *templateTagWithKeyPathAndDelims(NSMutableDictionary 
**dict, NSString *keyPath, NSString *openDelim, NSString *closeDelim) {
-    NSString *endTag = [*dict objectForKey:keyPath];
+static inline NSString *templateTagWithKeyPathAndDelims(NSMutableDictionary 
*dict, NSString *keyPath, NSString *openDelim, NSString *closeDelim) {
+    NSString *endTag = [dict objectForKey:keyPath];
     if (nil == endTag) {
-        if (*dict == nil)
-            *dict = [[NSMutableDictionary alloc] init];
         endTag = [[NSString alloc] initWithFormat:@"%@%@%@", openDelim, 
keyPath, closeDelim];
-        [*dict setObject:endTag forKey:keyPath];
+        [dict setObject:endTag forKey:keyPath];
         [endTag release];
     }
     return endTag;
@@ -115,25 +113,33 @@
 
 static inline NSString *endCollectionTagWithKeyPath(NSString *keyPath){
     static NSMutableDictionary *endCollectionDict = nil;
-    return templateTagWithKeyPathAndDelims(&endCollectionDict, keyPath, 
END_TAG_OPEN_DELIM, COLLECTION_TAG_CLOSE_DELIM);
+    if (endCollectionDict == nil)
+        endCollectionDict = [[NSMutableDictionary alloc] init];
+    return templateTagWithKeyPathAndDelims(endCollectionDict, keyPath, 
END_TAG_OPEN_DELIM, COLLECTION_TAG_CLOSE_DELIM);
 }
 
 static inline NSString *sepCollectionTagWithKeyPath(NSString *keyPath){
     static NSMutableDictionary *sepCollectionDict = nil;
-    return templateTagWithKeyPathAndDelims(&sepCollectionDict, keyPath, 
ALT_TAG_OPEN_DELIM, COLLECTION_TAG_CLOSE_DELIM);
+    if (sepCollectionDict == nil)
+        sepCollectionDict = [[NSMutableDictionary alloc] init];
+    return templateTagWithKeyPathAndDelims(sepCollectionDict, keyPath, 
ALT_TAG_OPEN_DELIM, COLLECTION_TAG_CLOSE_DELIM);
 }
 
 static inline NSString *endConditionTagWithKeyPath(NSString *keyPath){
     static NSMutableDictionary *endConditionDict = nil;
-    return templateTagWithKeyPathAndDelims(&endConditionDict, keyPath, 
END_TAG_OPEN_DELIM, CONDITION_TAG_CLOSE_DELIM);
+    if (endConditionDict == nil)
+        endConditionDict = [[NSMutableDictionary alloc] init];
+    return templateTagWithKeyPathAndDelims(endConditionDict, keyPath, 
END_TAG_OPEN_DELIM, CONDITION_TAG_CLOSE_DELIM);
 }
 
 static inline NSString *altConditionTagWithKeyPath(NSString *keyPath){
     static NSMutableDictionary *altConditionDict = nil;
-    return templateTagWithKeyPathAndDelims(&altConditionDict, keyPath, 
ALT_TAG_OPEN_DELIM, CONDITION_TAG_CLOSE_DELIM);
+    if (altConditionDict == nil)
+        altConditionDict = [[NSMutableDictionary alloc] init];
+    return templateTagWithKeyPathAndDelims(altConditionDict, keyPath, 
ALT_TAG_OPEN_DELIM, CONDITION_TAG_CLOSE_DELIM);
 }
 
-static inline NSString *compareConditionTagWithKeyPath(NSString *keyPath, 
BDSKTemplateTagMatchType matchType){
+static inline NSString *compareConditionTagWithKeyPath(NSString *keyPath, 
BDSKTemplateTagMatchType matchType) {
     static NSMutableDictionary *equalConditionDict = nil;
     static NSMutableDictionary *containConditionDict = nil;
     static NSMutableDictionary *smallerConditionDict = nil;
@@ -144,21 +150,37 @@
     static NSMutableDictionary *notContainConditionDict = nil;
     switch (matchType) {
         case BDSKTemplateTagMatchEqual:
-            return templateTagWithKeyPathAndDelims(&equalConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_EQUAL);
+            if (equalConditionDict == nil)
+                equalConditionDict = [[NSMutableDictionary alloc] init];
+            return templateTagWithKeyPathAndDelims(equalConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_EQUAL);
         case BDSKTemplateTagMatchContain:
-            return templateTagWithKeyPathAndDelims(&containConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_CONTAIN);
+            if (containConditionDict == nil)
+                containConditionDict = [[NSMutableDictionary alloc] init];
+            return templateTagWithKeyPathAndDelims(containConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_CONTAIN);
         case BDSKTemplateTagMatchSmaller:
-            return templateTagWithKeyPathAndDelims(&smallerConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_SMALLER);
+            if (smallerConditionDict == nil)
+                smallerConditionDict = [[NSMutableDictionary alloc] init];
+            return templateTagWithKeyPathAndDelims(smallerConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_SMALLER);
         case BDSKTemplateTagMatchSmallerOrEqual:
-            return 
templateTagWithKeyPathAndDelims(&smallerOrEqualConditionDict, keyPath, 
ALT_TAG_OPEN_DELIM, CONDITION_TAG_SMALLER_OR_EQUAL);
+            if (smallerOrEqualConditionDict == nil)
+                smallerOrEqualConditionDict = [[NSMutableDictionary alloc] 
init];
+            return 
templateTagWithKeyPathAndDelims(smallerOrEqualConditionDict, keyPath, 
ALT_TAG_OPEN_DELIM, CONDITION_TAG_SMALLER_OR_EQUAL);
         case BDSKTemplateTagMatchLarger:
-            return templateTagWithKeyPathAndDelims(&largerConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_LARGER);
+            if (largerConditionDict == nil)
+                largerConditionDict = [[NSMutableDictionary alloc] init];
+            return templateTagWithKeyPathAndDelims(largerConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_LARGER);
         case BDSKTemplateTagMatchLargerOrEqual:
-            return 
templateTagWithKeyPathAndDelims(&largerOrEqualConditionDict, keyPath, 
ALT_TAG_OPEN_DELIM, CONDITION_TAG_LARGER_OR_EQUAL);
+            if (largerOrEqualConditionDict == nil)
+                largerOrEqualConditionDict = [[NSMutableDictionary alloc] 
init];
+            return templateTagWithKeyPathAndDelims(largerOrEqualConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_LARGER_OR_EQUAL);
         case BDSKTemplateTagMatchNotEqual:
-            return templateTagWithKeyPathAndDelims(&notEqualConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_NOT_EQUAL);
+            if (notEqualConditionDict == nil)
+                notEqualConditionDict = [[NSMutableDictionary alloc] init];
+            return templateTagWithKeyPathAndDelims(notEqualConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_NOT_EQUAL);
         case BDSKTemplateTagMatchNotContain:
-            return templateTagWithKeyPathAndDelims(&notContainConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_NOT_CONTAIN);
+            if (notContainConditionDict == nil)
+                notContainConditionDict = [[NSMutableDictionary alloc] init];
+            return templateTagWithKeyPathAndDelims(notContainConditionDict, 
keyPath, ALT_TAG_OPEN_DELIM, CONDITION_TAG_NOT_CONTAIN);
         default:
             return nil;
     }

Modified: trunk/bibdesk/BDSKURLGroup.m
===================================================================
--- trunk/bibdesk/BDSKURLGroup.m        2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKURLGroup.m        2024-01-06 17:53:06 UTC (rev 28558)
@@ -50,6 +50,7 @@
 #import "NSFileManager_BDSKExtensions.h"
 #import "BibItem.h"
 #import "BDSKMacroResolver.h"
+#import "BibDocument.h"
 
 @implementation BDSKURLGroup
 

Modified: trunk/bibdesk/BDSKWebGroup.m
===================================================================
--- trunk/bibdesk/BDSKWebGroup.m        2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKWebGroup.m        2024-01-06 17:53:06 UTC (rev 28558)
@@ -270,12 +270,11 @@
                 NSString *encodingName = [dataSource textEncodingName];
                 NSStringEncoding encoding = encodingName ? [NSString 
encodingForIANACharSetName:encodingName] : NSUTF8StringEncoding;
                 if (encoding != kCFStringEncodingInvalidId)
-                    string = [[NSString alloc] initWithData:data 
encoding:encoding];
+                    string = [[[NSString alloc] initWithData:data 
encoding:encoding] autorelease];
                 if (nil == string && encoding != NSUTF8StringEncoding)
-                    string = [[NSString alloc] initWithData:data 
encoding:NSUTF8StringEncoding];
+                    string = [[[NSString alloc] initWithData:data 
encoding:NSUTF8StringEncoding] autorelease];
                 if (nil == string && encoding != NSISOLatin1StringEncoding)
-                    string = [[NSString alloc] initWithData:data 
encoding:NSISOLatin1StringEncoding];
-                [string autorelease];
+                    string = [[[NSString alloc] initWithData:data 
encoding:NSISOLatin1StringEncoding] autorelease];
             }
             BDSKStringType type = [string contentStringType];
             if (type == BDSKStringTypeBibTeX)

Modified: trunk/bibdesk/BDSKWebGroupViewController.h
===================================================================
--- trunk/bibdesk/BDSKWebGroupViewController.h  2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BDSKWebGroupViewController.h  2024-01-06 17:53:06 UTC (rev 
28558)
@@ -57,4 +57,6 @@
 - (IBAction)goBackForward:(id)sender;
 - (IBAction)stopOrReloadAction:(id)sender;
 
+- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject;
+
 @end

Modified: trunk/bibdesk/BDSKZoomGroupServer.m
===================================================================
--- trunk/bibdesk/BDSKZoomGroupServer.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BDSKZoomGroupServer.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -306,10 +306,10 @@
             [self resetConnectionWithInfo:info];
         
         if ([info removeDiacritics]) {
-            CFMutableStringRef mutableCopy = (CFMutableStringRef)[[searchTerm 
mutableCopy] autorelease];
-            CFStringNormalize(mutableCopy, kCFStringNormalizationFormD);
-            BDDeleteCharactersInCharacterSet(mutableCopy, 
CFCharacterSetGetPredefined(kCFCharacterSetNonBase));
-            searchTerm = (NSString *)mutableCopy;
+            NSMutableString *mutableCopy = [searchTerm mutableCopy];
+            CFStringNormalize((__bridge CFMutableStringRef)mutableCopy, 
kCFStringNormalizationFormD);
+            BDDeleteCharactersInCharacterSet((__bridge 
CFMutableStringRef)mutableCopy, 
CFCharacterSetGetPredefined(kCFCharacterSetNonBase));
+            searchTerm = [mutableCopy autorelease];
         }
         
         BOOL isOPAC = [[info recordSyntax] isEqualToString:OPAC_STRING];

Modified: trunk/bibdesk/BibAuthor+Scripting.m
===================================================================
--- trunk/bibdesk/BibAuthor+Scripting.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibAuthor+Scripting.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -40,6 +40,7 @@
 #import "BDSKOwnerProtocol.h"
 #import "NSObject_BDSKExtensions.h"
 #import "BibDocument_Actions.h"
+#import "BDSKGroup.h"
 
 @implementation BibAuthor (Scripting)
 

Modified: trunk/bibdesk/BibAuthor.m
===================================================================
--- trunk/bibdesk/BibAuthor.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibAuthor.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -248,7 +248,7 @@
     if (matchAuthorNamesExactly)
         return [self hash];
     // fuzzyEqual: is based on fuzzyName, so also hash must be based on that
-    return BDCaseInsensitiveStringHash(fuzzyName);
+    return BDCaseInsensitiveStringHash((__bridge CFType)fuzzyName);
 }
 
 - (NSComparisonResult)sortCompare:(BibAuthor *)otherAuth{ // used for 
tableview sorts; omits von and jr parts

Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m       2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BibDocument+Scripting.m       2024-01-06 17:53:06 UTC (rev 
28558)
@@ -54,6 +54,7 @@
 #import "BDSKStaticGroup.h"
 #import "BDSKCategoryGroup.h"
 #import "BDSKWebGroup.h"
+#import "BDSKParentGroup.h"
 #import "BDSKGroupsArray.h"
 #import "NSObject_BDSKExtensions.h"
 #import "NSArray_BDSKExtensions.h"

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibDocument.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -125,6 +125,7 @@
 #import "NSLayoutConstraint_BDSKExtensions.h"
 #import "BDSKCompletionManager.h"
 #import "NSPointerFunctions_BDSKExtensions.h"
+#import "BDSKWebGroupViewController.h"
 
 // these are the same as in Info.plist
 NSString *BDSKBibTeXDocumentType = @"BibTeX Database";

Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibDocument_Actions.m 2024-01-06 17:53:06 UTC (rev 28558)
@@ -1050,7 +1050,7 @@
                 if (aFile == nil)
                     return;
                 NSURL *oldURL = [[[publication objectInFilesAtIndex:anIndex] 
URL] retain];
-                [publication replaceObjectInFilesAtIndex:anIndex 
withObject:anIndex];
+                [publication replaceObjectInFilesAtIndex:anIndex 
withObject:aFile];
                 [[self undoManager] setActionName:NSLocalizedString(@"Edit 
Publication", @"Undo action name")];
                 if (oldURL)
                     [self userRemovedURL:oldURL forPublication:publication];

Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m      2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/BibDocument_DataSource.m      2024-01-06 17:53:06 UTC (rev 
28558)
@@ -88,6 +88,8 @@
 #import "BDSKCategoryFormatter.h"
 #import "BDSKControlTableCellView.h"
 #import "NSPointerFunctions_BDSKExtensions.h"
+#import "BDSKCustomCiteDrawerController.h"
+#import "BDSKZoomablePDFView.h"
 
 #define MAX_DRAG_IMAGE_WIDTH 700.0
 

Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m  2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibDocument_Groups.m  2024-01-06 17:53:06 UTC (rev 28558)
@@ -47,6 +47,7 @@
 #import "BibDocument_DataSource.h"
 #import "BDSKGroup.h"
 #import "BDSKSharedGroup.h"
+#import "BDSKLibraryGroup.h"
 #import "BDSKURLGroup.h"
 #import "BDSKScriptGroup.h"
 #import "BDSKSmartGroup.h"
@@ -1717,11 +1718,11 @@
 static CFHashCode BibAuthorFuzzyHash(const void *value)
 {
     BDSKASSERT([(__bridge id)value isKindOfClass:[BibAuthor class]]);
-    return [(BibAuthor *)value fuzzyHash];
+    return [(__bridge BibAuthor *)value fuzzyHash];
 }
 
 static Boolean BibAuthorFuzzyEqual(const void *value1, const void *value2)
 {
     BDSKASSERT([(__bridge id)value1 isKindOfClass:[BibAuthor class]] && 
[(__bridge id)value2 isKindOfClass:[BibAuthor class]]);
-    return [(BibAuthor *)value1 fuzzyEqual:(BibAuthor *)value2];
+    return [(__bridge BibAuthor *)value1 fuzzyEqual:(__bridge BibAuthor 
*)value2];
 }

Modified: trunk/bibdesk/BibDocument_Menus.m
===================================================================
--- trunk/bibdesk/BibDocument_Menus.m   2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibDocument_Menus.m   2024-01-06 17:53:06 UTC (rev 28558)
@@ -52,6 +52,7 @@
 #import "BDSKGroupsArray.h"
 #import "BDSKCustomCiteDrawerController.h"
 #import "BDSKPreviewer.h"
+#import "BDSKStatusBar.h"
 #import <objc/runtime.h>
 
 @implementation BibDocument (Menus)

Modified: trunk/bibdesk/BibDocument_UI.m
===================================================================
--- trunk/bibdesk/BibDocument_UI.m      2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibDocument_UI.m      2024-01-06 17:53:06 UTC (rev 28558)
@@ -44,6 +44,7 @@
 #import "BibItem.h"
 #import "BDSKGroup.h"
 #import "BDSKSearchGroup.h"
+#import "BDSKParentGroup.h"
 #import "BDSKLinkedFile.h"
 #import "BDSKTypeManager.h"
 #import "BDSKPublicationsArray.h"

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/BibItem.m     2024-01-06 17:53:06 UTC (rev 28558)
@@ -496,7 +496,7 @@
 
 - (NSUInteger)equivalenceHash{
     NSString *type = [self pubType] ?: @"";
-    CFHashCode hash = BDCaseInsensitiveStringHash(type);
+    CFHashCode hash = BDCaseInsensitiveStringHash((__bridge void *)type);
     NSUInteger prime = 31;
     NSUInteger factor = 1;
 
@@ -3282,7 +3282,7 @@
         NSSet *types = [NSSet setWithArray:[[NSUserDefaults 
standardUserDefaults] stringArrayForKey:BDSKURLTypesToDownloadKey]];
         NSString *MIMEType = [[download response] MIMEType];
         if (MIMEType) {
-            CFStringRef theUTI = 
UTTypeCreatePreferredIdentifierForTag((CFStringRef)MIMEType, 
kUTTagClassMIMEType, NULL);
+            CFStringRef theUTI = 
UTTypeCreatePreferredIdentifierForTag((__bridge CFStringRef)MIMEType, 
kUTTagClassMIMEType, NULL);
             if (theUTI) {
                 NSSet *extensions = [NSSet setWithArray:[[(NSArray 
*)UTTypeCopyAllTagsWithClass(theUTI, kUTTagClassFilenameExtension) autorelease] 
valueForKey:@"lowercaseString"]];
                 CFRelease(theUTI);

Modified: trunk/bibdesk/Bibdesk_Prefix.pch
===================================================================
--- trunk/bibdesk/Bibdesk_Prefix.pch    2024-01-05 23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/Bibdesk_Prefix.pch    2024-01-06 17:53:06 UTC (rev 28558)
@@ -77,9 +77,9 @@
             } \
         } while (0)
 
-    #define BDSKDESTROY(variable) do { [variable release]; variable = nil; } 
while (0)
+    #define BDSKDESTROY(variable) variable = nil
     #define BDSKCFDESTROY(variable) do { if (variable) CFRelease(variable); 
variable = NULL; } while (0)
     #define BDSKFREEDESTROY(variable) do { if (variable) free((void 
*)variable); variable = NULL; } while (0)
-    #define BDSKDISPATCHDESTROY(variable) do { if (variable) 
dispatch_release(variable); variable = NULL; } while (0)
+    #define BDSKDISPATCHDESTROY(variable) variable = nil
 
 #endif

Modified: trunk/bibdesk/NSAppleEventDescriptor_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSAppleEventDescriptor_BDSKExtensions.m       2024-01-05 
23:20:24 UTC (rev 28557)
+++ trunk/bibdesk/NSAppleEventDescriptor_BDSKExtensions.m       2024-01-06 
17:53:06 UTC (rev 28558)
@@ -95,8 +95,8 @@
         case typeUInt32:
         {
             UInt32 retValue;
-            self = [self coerceToDescriptorType:typeUInt32];
-            [[self data] getBytes:&retValue length:[[self data] length]];
+            NSData *data = [[self coerceToDescriptorType:typeUInt32] data];
+            [data getBytes:&retValue length:[data length]];
             return [NSNumber numberWithUnsignedInt:retValue];
         }
         case typeUInt64:
@@ -121,8 +121,8 @@
         {
             // we cannot create a NSNumber with a 128 bit floating point (long 
double)
             Float64 retValue;
-            self = [self coerceToDescriptorType:typeIEEE64BitFloatingPoint];
-            [[self data] getBytes:&retValue length:[[self data] length]];
+            NSData *data = [[self 
coerceToDescriptorType:typeIEEE64BitFloatingPoint] data];
+            [data getBytes:&retValue length:[data length]];
             return [NSNumber numberWithDouble:retValue];
         }
         case typeEnumerated:

Modified: trunk/bibdesk/NSAttributedString_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSAttributedString_BDSKExtensions.m   2024-01-05 23:20:24 UTC 
(rev 28557)
+++ trunk/bibdesk/NSAttributedString_BDSKExtensions.m   2024-01-06 17:53:06 UTC 
(rev 28558)
@@ -63,12 +63,10 @@
     NSUInteger startLoc; // starting character index to apply tex attributes
     NSUInteger endLoc;   // ending index to apply tex attributes
     
-    CFAllocatorRef alloc = CFGetAllocator(mutableString);
-    
     while( (cmdRange = [mutableString 
rangeOfTeXCommandInRange:searchRange]).location != NSNotFound){
         
         // copy the command
-        texStyle = CFBridgingRelease(CFStringCreateWithSubstring(alloc, 
(__bridge CFStringRef)mutableString, CFRangeMake(cmdRange.location, 
cmdRange.length)));
+        texStyle = 
CFBridgingRelease(CFStringCreateWithSubstring(kCFAllocatorDefault, (__bridge 
CFStringRef)mutableString, CFRangeMake(cmdRange.location, cmdRange.length)));
         
         // delete the command, now that we know what it was
         [mutableString deleteCharactersInRange:cmdRange];

Modified: trunk/bibdesk/NSPasteboard_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSPasteboard_BDSKExtensions.m 2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/NSPasteboard_BDSKExtensions.m 2024-01-06 17:53:06 UTC (rev 
28558)
@@ -195,7 +195,7 @@
             PasteboardSynchronize(pboardRef);
             CFURLRef urlRef = NULL;
             if (noErr == PasteboardCopyPasteLocation(pboardRef, &urlRef))
-                pasteLocationURL = [(NSURL *)urlRef autorelease];
+                pasteLocationURL = CFBridgingRelease(urlRef);
             CFRelease(pboardRef);
         }
     }

Modified: trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m   2024-01-05 23:20:24 UTC 
(rev 28557)
+++ trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m   2024-01-06 17:53:06 UTC 
(rev 28558)
@@ -80,7 +80,7 @@
 static BOOL BibItemEquivalent(const void *item1, const void *item2, NSUInteger 
(*size)(const void *item))
 {
     BDSKASSERT([(__bridge id)item1 isKindOfClass:[BibItem class]] && 
[(__bridge id)item2 isKindOfClass:[BibItem class]]);
-    return ([(__bridge BibItem *)item1 isEquivalentToItem:(BibItem *)item2]);
+    return ([(__bridge BibItem *)item1 isEquivalentToItem:(__bridge BibItem 
*)item2]);
 }
 
 static NSUInteger BibItemEquivalenceHash(const void *item, NSUInteger 
(*size)(const void *item))

Modified: trunk/bibdesk/NSString_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSString_BDSKExtensions.h     2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/NSString_BDSKExtensions.h     2024-01-06 17:53:06 UTC (rev 
28558)
@@ -85,15 +85,6 @@
 + (NSString *)hexStringForCharacter:(unichar)ch;
 
 /*!
-    @method     ratingStringWithInteger:
-    @abstract   Returns a sequence of digits as bubbles surrounding each 
character
-    @discussion Requires a font with characters 0x278A-278E
-    @param      rating (description)
-    @result     (description)
-*/
-+ (NSString *)ratingStringWithInteger:(NSInteger)rating;
-
-/*!
  @method     stringWithBool:
  @abstract   Returns a localized string describing the boolean value. 
  @discussion (comprehensive description)

Modified: trunk/bibdesk/NSString_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSString_BDSKExtensions.m     2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/NSString_BDSKExtensions.m     2024-01-06 17:53:06 UTC (rev 
28558)
@@ -154,25 +154,6 @@
     return string;
 }
 
-static NSInteger MAX_RATING = 5;
-+ (NSString *)ratingStringWithInteger:(NSInteger)rating;
-{
-    NSParameterAssert(rating >= 0 && rating <= MAX_RATING);
-    static NSString **ratingStrings = NULL;
-    if(ratingStrings == NULL){
-        ratingStrings = malloc((MAX_RATING + 1) * sizeof(NSString *));
-        NSInteger i = 0;
-        NSMutableString *ratingString = [NSMutableString string];
-        do {
-            ratingStrings[rating] = [ratingString copy];
-            [ratingString appendFormat:@"%C", (unichar)(0x278A + i)];
-        } while(i++ < MAX_RATING);
-    }
-    if (rating >= 0 && rating <= MAX_RATING)
-        return ratingStrings[rating];
-    return nil;
-}
-
 + (NSString *)stringWithBool:(BOOL)boolValue {
        return boolValue ? @"1" : @"0";
 }
@@ -1120,7 +1101,7 @@
 
 - (NSString *)stringByCollapsingCharactersInSet:(NSCharacterSet *)charSet;
 {
-    return 
CFBridgingRelease(BDStringCreateByCollapsingCharactersInSet(CFAllocatorGetDefault(),
 (__bridge CFStringRef)self, (CFCharacterSetRef)charSet));
+    return 
CFBridgingRelease(BDStringCreateByCollapsingCharactersInSet(CFAllocatorGetDefault(),
 (__bridge CFStringRef)self, (__bridge CFCharacterSetRef)charSet));
 }
 
 - (NSString *)stringByCollapsingAndTrimmingCharactersInSet:(NSCharacterSet 
*)charSet;
@@ -2014,15 +1995,15 @@
 }
 
 - (void)deleteCharactersInCharacterSet:(NSCharacterSet *)characterSet {
-    BDDeleteCharactersInCharacterSet((__bridge CFMutableStringRef)self, 
(CFCharacterSetRef)characterSet);
+    BDDeleteCharactersInCharacterSet((__bridge CFMutableStringRef)self, 
(__bridge CFCharacterSetRef)characterSet);
 }
 
 - (void)deleteUnescapedCharactersInCharacterSet:(NSCharacterSet *)characterSet 
{
-    BDDeleteUnescapedCharactersInCharacterSet((__bridge 
CFMutableStringRef)self, (CFCharacterSetRef)characterSet);
+    BDDeleteUnescapedCharactersInCharacterSet((__bridge 
CFMutableStringRef)self, (__bridge CFCharacterSetRef)characterSet);
 }
 
 - (void)replaceOccurrencesOfCharactersInSet:(NSCharacterSet *)set 
withString:(NSString *)replaceString {
-    BDReplaceCharactersInCharacterSet((__bridge CFMutableStringRef)self, 
(CFCharacterSetRef)set, (CFStringRef)replaceString);
+    BDReplaceCharactersInCharacterSet((__bridge CFMutableStringRef)self, 
(__bridge CFCharacterSetRef)set, (__bridge CFStringRef)replaceString);
 }
 
 - (void)replaceComposedCharacters {

Modified: trunk/bibdesk/NSURL_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSURL_BDSKExtensions.m        2024-01-05 23:20:24 UTC (rev 
28557)
+++ trunk/bibdesk/NSURL_BDSKExtensions.m        2024-01-06 17:53:06 UTC (rev 
28558)
@@ -274,14 +274,14 @@
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
     CFNetDiagnosticRef diagnostic = 
CFNetDiagnosticCreateWithURL(kCFAllocatorDefault, (__bridge CFURLRef)self);
     
-    NSString *details;
-    CFNetDiagnosticStatus status = 
CFNetDiagnosticCopyNetworkStatusPassively(diagnostic, (CFStringRef *)&details);
+    CFStringRef details;
+    CFNetDiagnosticStatus status = 
CFNetDiagnosticCopyNetworkStatusPassively(diagnostic, &details);
     CFRelease(diagnostic);
-    [details autorelease];
     
     BOOL canConnect = kCFNetDiagnosticConnectionUp == status;
     if (NO == canConnect)
         NSLog(@"%@", details);
+    if (details) CFRelease(details);
 #pragma clang diagnostic pop
     
     return canConnect;

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to