Revision: 28960 http://sourceforge.net/p/bibdesk/svn/28960 Author: hofman Date: 2024-10-16 16:09:46 +0000 (Wed, 16 Oct 2024) Log Message: ----------- Declare variable in for loop to avoid making it strong
Modified Paths: -------------- trunk/bibdesk/BDSKApplication.m trunk/bibdesk/BDSKDOIWebParser.m trunk/bibdesk/BDSKEditor.m trunk/bibdesk/BDSKHCiteParser.m trunk/bibdesk/BDSKISIGroupServer.m trunk/bibdesk/BDSKMARCParser.m trunk/bibdesk/BDSKSearchBookmarkController.m trunk/bibdesk/BDSKSearchGroup.m trunk/bibdesk/BDSKSharingBrowser.m trunk/bibdesk/BDSKTask.m trunk/bibdesk/BDSKTemplate.m trunk/bibdesk/BDSKTemplateDocument.m trunk/bibdesk/BDSKTemplateObjectProxy.m trunk/bibdesk/BibDocument.m trunk/bibdesk/BibDocument_DataSource.m trunk/bibdesk/BibDocument_UI.m trunk/bibdesk/BibItem.m trunk/bibdesk/BibPref_Defaults.m trunk/bibdesk/NSFileManager_BDSKExtensions.m trunk/bibdesk/NSFont_BDSKExtensions.m Modified: trunk/bibdesk/BDSKApplication.m =================================================================== --- trunk/bibdesk/BDSKApplication.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKApplication.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -138,13 +138,12 @@ if ([toSort count] > 1) [toSort sortUsingDescriptors:@[[[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES selector:@selector(caseInsensitiveCompare:)]]]; - for (item in mainItems) { - [windowsMenu addItem:item]; - NSDocument *doc = [[[item target] windowController] document]; + for (NSMenuItem *anItem in mainItems) { + [windowsMenu addItem:anItem]; + NSDocument *doc = [[[anItem target] windowController] document]; NSArray *subArray = [subItems objectForKey:doc]; if ([subArray count]) { - NSMenuItem *subItem; - for (subItem in subArray) + for (NSMenuItem *subItem in subArray) [windowsMenu addItem:subItem]; } [subItems removeObjectForKey:doc]; @@ -152,13 +151,13 @@ if ([subItems count]) { for (NSDocument *doc in subItems) { - for (item in [subItems objectForKey:doc]) - [windowsMenu addItem:item]; + for (NSMenuItem *anItem in [subItems objectForKey:doc]) + [windowsMenu addItem:anItem]; } } - for (item in auxItems) - [windowsMenu addItem:item]; + for (NSMenuItem *anItem in auxItems) + [windowsMenu addItem:anItem]; } - (void)addWindowsItem:(NSWindow *)aWindow title:(NSString *)aString filename:(BOOL)isFilename { Modified: trunk/bibdesk/BDSKDOIWebParser.m =================================================================== --- trunk/bibdesk/BDSKDOIWebParser.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKDOIWebParser.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -67,15 +67,13 @@ NSURL *baseURL = [NSURL URLWithString:@"https://doi.org/"]; DOMNode *rootElement = [[self domDocument] documentElement]; NSArray *nodes = nil; - DOMNode *node; - AGRegex *doiRegex = [AGRegex regexWithPattern:@"^(doi:|https?://(dx\\.)?doi\\.org/)?(10\\.[0-9]{4,}(\\.[0-9]+)*/\\S+)$" options:AGRegexCaseInsensitive]; - AGRegexMatch *match; NSString *doi; - node = [rootElement singleNodeForXPath:headMetaDoiXPath]; + DOMNode *node = [rootElement singleNodeForXPath:headMetaDoiXPath]; if (node) { + AGRegexMatch *match; doi = [node stringValueOfAttribute:@"content"]; if (doi && (match = [doiRegex findInString:doi])) { doi = [match groupAtIndex:3]; @@ -88,8 +86,9 @@ if ([dois count] == 0) { nodes = [rootElement nodesForXPath:bodyDoiXPath]; - for (node in nodes) { - doi = [node stringValueOfAttribute:@"href"]; + for (DOMNode *aNode in nodes) { + AGRegexMatch *match; + doi = [aNode stringValueOfAttribute:@"href"]; if (doi && (match = [doiRegex findInString:doi])) { doi = [[match groupAtIndex:3] stringByTrimmingCharactersInSet:[NSCharacterSet punctuationCharacterSet]]; if ([dois containsObject:doi] == NO) @@ -103,7 +102,7 @@ doiRegex = [AGRegex regexWithPattern:@"(doi:[ \\t]*|https?://(dx\\.)?doi\\.org/)(10\\.[0-9]{4,}(\\.[0-9]+)*/\\S+)" options:AGRegexCaseInsensitive]; - for (match in [doiRegex findAllInString:text]) { + for (AGRegexMatch *match in [doiRegex findAllInString:text]) { doi = [[match groupAtIndex:3] stringByTrimmingCharactersInSet:[NSCharacterSet punctuationCharacterSet]]; if ([[match groupAtIndex:1] hasPrefix:@"http"] == NO) doi = [doi stringByAddingPercentEscapesForPath]; Modified: trunk/bibdesk/BDSKEditor.m =================================================================== --- trunk/bibdesk/BDSKEditor.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKEditor.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -493,10 +493,9 @@ else urls = [publication valueForKeyPath:@"localFiles.URL"]; - for (fileURL in urls) { - if ([fileURL isEqual:[NSNull null]] == NO) { - [[NSWorkspace sharedWorkspace] openURLWithDefaultApp:fileURL]; - } + for (NSURL *url in urls) { + if ([url isEqual:[NSNull null]] == NO) + [[NSWorkspace sharedWorkspace] openURLWithDefaultApp:url]; } } @@ -526,9 +525,9 @@ else urls = [publication valueForKeyPath:@"remoteURLs.URL"]; - for (remoteURL in urls) { - if ([remoteURL isEqual:[NSNull null]] == NO) { - [[NSWorkspace sharedWorkspace] openURLWithDefaultApp:remoteURL]; + for (NSURL *url in urls) { + if ([url isEqual:[NSNull null]] == NO) { + [[NSWorkspace sharedWorkspace] openURLWithDefaultApp:url]; } } } @@ -544,9 +543,9 @@ else urls = [publication valueForKeyPath:@"localFiles.URL"]; - for (fileURL in urls) { - if ([fileURL isEqual:[NSNull null]] == NO) { - BDSKNotesWindowController *notesController = [[BDSKNotesWindowController alloc] initWithURL:fileURL]; + for (NSURL *url in urls) { + if ([url isEqual:[NSNull null]] == NO) { + BDSKNotesWindowController *notesController = [[BDSKNotesWindowController alloc] initWithURL:url]; [[self document] addWindowController:notesController]; [notesController showWindow:self]; @@ -566,9 +565,9 @@ else urls = [publication valueForKeyPath:@"localFiles.URL"]; - for (fileURL in urls) { - if ([fileURL isEqual:[NSNull null]] == NO) { - NSString *notes = [fileURL textSkimNotes]; + for (NSURL *url in urls) { + if ([url isEqual:[NSNull null]] == NO) { + NSString *notes = [url textSkimNotes]; if ([notes length]) { if ([string length]) @@ -1550,11 +1549,9 @@ - (void)fileView:(FVFileView *)aFileView insertURLs:(NSArray *)absoluteURLs atIndexes:(NSIndexSet *)aSet forDrop:(id <NSDraggingInfo>)info dropOperation:(FVDropOperation)operation; { NSMutableArray *files = [NSMutableArray array]; - BDSKLinkedFile *aFile; - NSURL *aURL; - for (aURL in absoluteURLs) { - aFile = [BDSKLinkedFile linkedFileWithURL:aURL delegate:publication]; + for (NSURL *aURL in absoluteURLs) { + BDSKLinkedFile *aFile = [BDSKLinkedFile linkedFileWithURL:aURL delegate:publication]; if (aFile == nil) { NSBeep(); return; @@ -1564,11 +1561,11 @@ [publication insertFiles:files atIndexes:aSet]; - for (aURL in absoluteURLs) + for (NSURL *aURL in absoluteURLs) [[self document] userAddedURL:aURL forPublication:publication]; if (([NSEvent standardModifierFlags] & NSEventModifierFlagCommand) == 0) { - for (aFile in files) { + for (BDSKLinkedFile *aFile in files) { if ([aFile isFile]) [publication autoFileLinkedFile:aFile]; } @@ -3177,7 +3174,6 @@ // build the new set of fields NSMutableArray *currentFields = [NSMutableArray array]; NSMutableArray *allFields = [[NSMutableArray alloc] init]; - NSString *field; BDSKTypeManager *tm = [BDSKTypeManager sharedManager]; NSString *type = [publication pubType]; NSMutableSet *ignoredKeys = [[NSMutableSet alloc] initWithObjects:BDSKDateAddedString, BDSKDateModifiedString, BDSKColorString, nil]; @@ -3187,7 +3183,7 @@ [allFields addObjectsFromArray:[tm standardFieldsForType:type]]; - for (field in allFields) { + for (NSString *field in allFields) { if ([ignoredKeys containsObject:field] == NO) { [ignoredKeys addObject:field]; [currentFields addObject:field]; @@ -3198,7 +3194,7 @@ [allFields addNonDuplicateObjectsFromArray:[addedFields allObjects]]; [allFields sortUsingSelector:@selector(caseInsensitiveNumericCompare:)]; - for (field in allFields) { + for (NSString *field in allFields) { if ([ignoredKeys containsObject:field] == NO) { [ignoredKeys addObject:field]; if ([addedFields containsObject:field] || NO == [[publication valueOfField:field inherit:NO] isEqualAsComplexString:@""]) Modified: trunk/bibdesk/BDSKHCiteParser.m =================================================================== --- trunk/bibdesk/BDSKHCiteParser.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKHCiteParser.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -107,7 +107,6 @@ BDSKTypeManager *typeMan = [BDSKTypeManager sharedManager]; NSMutableDictionary *rd = [NSMutableDictionary dictionaryWithCapacity:0]; NSArray *nodes; - DOMNode *node; NSMutableArray *array; // find type but not type that's a descendant of 'container'. @@ -114,7 +113,7 @@ nodes = [citationNode nodesForXPathExpression:[xpaths objectForKey:@"type"]]; NSString *typeString = nil; - for (node in nodes) { + for (DOMNode *node in nodes) { if(isContainer || [self nodeHasContainerParent:node] == NO) typeString = [self fullStringValueIfABBRFromNode:node]; } @@ -130,7 +129,7 @@ nodes = [citationNode nodesForXPathExpression:[xpaths objectForKey:@"title"]]; - for(node in nodes){ + for(DOMNode *node in nodes){ // deal with this citation's container later // note: todo - avoid second hasParentWithClassName by finding container // nodes first and caching those then checking against them here. (if necessary) @@ -143,7 +142,7 @@ nodes = [citationNode nodesForXPathExpression:[xpaths objectForKey:@"author"]]; array = [NSMutableArray array]; - for(node in nodes) + for(DOMNode *node in nodes) [array addObject:[self BTAuthorStringFromVCardNode:node xpath:[xpaths objectForKey:@"fn"]]]; [rd setObject:[array componentsJoinedByString:@" and "] forKey:BDSKAuthorString]; @@ -164,7 +163,7 @@ // find date published // Only use the first such node. - node = [citationNode singleNodeForXPathExpression:[xpaths objectForKey:@"date-published"]]; + DOMNode *node = [citationNode singleNodeForXPathExpression:[xpaths objectForKey:@"date-published"]]; if(node) { NSDate *datePublished = [self dateFromNode:node]; Modified: trunk/bibdesk/BDSKISIGroupServer.m =================================================================== --- trunk/bibdesk/BDSKISIGroupServer.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKISIGroupServer.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -785,7 +785,6 @@ NSXMLNode *staticChild = [[self nodesForXPath:@"./static_data" error:NULL] firstObject]; NSXMLNode *summaryChild = [[staticChild nodesForXPath:@"./summary" error:NULL] firstObject]; NSXMLNode *dynamicChild = [[self nodesForXPath:@"./dynamic_data" error:NULL] firstObject]; - NSXMLNode *child; /* get WOK UID */ addStringForXPathToDictionary(self, @"./UID", nil, WOK_UID_FIELDNAME, pubFields); @@ -795,16 +794,16 @@ addAuthorNamesToDictionary(authorNames, pubFields); /* get title, journal name etc */ - for (child in [summaryChild nodesForXPath:@"./titles/title" error:NULL]) { - NSString *typeString = [[(NSXMLElement *)child attributeForName:@"type"] stringValue]; + for (NSXMLNode *aChild in [summaryChild nodesForXPath:@"./titles/title" error:NULL]) { + NSString *typeString = [[(NSXMLElement *)aChild attributeForName:@"type"] stringValue]; if ([typeString isEqualToString:@"item"]) { - addStringToDictionaryIfNotNil([child stringValue], BDSKTitleString, pubFields); + addStringToDictionaryIfNotNil([aChild stringValue], BDSKTitleString, pubFields); } else if ([typeString isEqualToString:@"abbrev_iso"]) { - addStringToDictionaryIfNotNil([child stringValue], BDSKJournalString, pubFields); + addStringToDictionaryIfNotNil([aChild stringValue], BDSKJournalString, pubFields); } else if ([typeString isEqualToString:@"source"]) { - source = useTitlecase ? [[child stringValue] titlecaseString] : [child stringValue]; + source = useTitlecase ? [[aChild stringValue] titlecaseString] : [aChild stringValue]; } else if ([typeString isEqualToString:@"source_abbrev"]) { - source_abbrev = [child stringValue]; + source_abbrev = [aChild stringValue]; } } if ([pubFields objectForKey:BDSKJournalString] == nil) { @@ -815,7 +814,7 @@ } /* get publication year, volume, issue and month */ - child = [[summaryChild nodesForXPath:@"./pub_info" error:NULL] firstObject]; + NSXMLNode *child = [[summaryChild nodesForXPath:@"./pub_info" error:NULL] firstObject]; if (child != nil) { addStringForXPathToDictionary(child, @"./@pubyear", nil, BDSKYearString, pubFields); addStringForXPathToDictionary(child, @"./@vol", nil, BDSKVolumeString, pubFields); @@ -888,16 +887,16 @@ addStringForXPathToDictionary(staticChild, @"./item/keywords_plus/keyword", keywordSeparator, BDSKKeywordsString, pubFields); /* get identifiers (DOI, ISSN, ISBN) */ - for (child in [dynamicChild nodesForXPath:@"./cluster_related/identifiers/identifier" error:NULL]) { - NSString *typeString = [[(NSXMLElement *)child attributeForName:@"type"] stringValue]; + for (NSXMLNode *aChild in [dynamicChild nodesForXPath:@"./cluster_related/identifiers/identifier" error:NULL]) { + NSString *typeString = [[(NSXMLElement *)aChild attributeForName:@"type"] stringValue]; if ([typeString isEqualToString:@"doi"]) { - addStringForXPathToDictionary(child, @"./@value", nil, BDSKDoiString, pubFields); + addStringForXPathToDictionary(aChild, @"./@value", nil, BDSKDoiString, pubFields); } else if ([typeString isEqualToString:@"issn"]) { - addStringForXPathToDictionary(child, @"./@value", nil, @"Issn", pubFields); + addStringForXPathToDictionary(aChild, @"./@value", nil, @"Issn", pubFields); } else if ([typeString isEqualToString:@"isbn"]) { - addStringForXPathToDictionary(child, @"./@value", nil, @"Isbn", pubFields); + addStringForXPathToDictionary(aChild, @"./@value", nil, @"Isbn", pubFields); } else if ([typeString isEqualToString:@"art_no"] && [pubFields objectForKey:BDSKNumberString] == nil) { - NSString *artnum = [[[(NSXMLElement *)child attributeForName:@"value"] stringValue] stringByRemovingPrefix:@"ARTN "]; + NSString *artnum = [[[(NSXMLElement *)aChild attributeForName:@"value"] stringValue] stringByRemovingPrefix:@"ARTN "]; addStringToDictionaryIfNotNil(artnum, BDSKNumberString, pubFields); } } @@ -947,14 +946,12 @@ addStringToDictionaryIfNotNil([self uid], WOK_UID_FIELDNAME, pubFields); - WokSearchLiteService_labelValuesPair *pair = nil; - - for (pair in [self authors]) { + for (WokSearchLiteService_labelValuesPair *pair in [self authors]) { if ([[pair label] isEqualToString:@"Authors"]) addAuthorNamesToDictionary([pair value], pubFields); } - for (pair in [self title]) { + for (WokSearchLiteService_labelValuesPair *pair in [self title]) { if ([[pair label] isEqualToString:@"Title"]) addStringToDictionaryIfNotNil([[pair value] firstObject], BDSKTitleString, pubFields); else if ([[pair label] isEqualToString:@"Issue"]) @@ -961,7 +958,7 @@ addStringToDictionaryIfNotNil([[pair value] firstObject], BDSKNumberString, pubFields); } - for (pair in [self source]) { + for (WokSearchLiteService_labelValuesPair *pair in [self source]) { if ([[pair label] isEqualToString:@"Pages"]) addStringToDictionaryIfNotNil([[pair value] firstObject], BDSKPagesString, pubFields); else if ([[pair label] isEqualToString:@"Published.BiblioDate"]) @@ -975,12 +972,12 @@ } NSString *keywordSeparator = [[NSUserDefaults standardUserDefaults] stringForKey:BDSKDefaultGroupFieldSeparatorKey]; - for (pair in [self keywords]) { + for (WokSearchLiteService_labelValuesPair *pair in [self keywords]) { if ([[pair label] isEqualToString:@"Keywords"]) addStringToDictionaryIfNotNil([[pair value] componentsJoinedByString:keywordSeparator], BDSKKeywordsString, pubFields); } - for (pair in [self other]) { + for (WokSearchLiteService_labelValuesPair *pair in [self other]) { if ([[pair label] isEqualToString:@"Identifier.Doi"]) addStringToDictionaryIfNotNil([[pair value] firstObject], BDSKDoiString, pubFields); else if ([[pair label] isEqualToString:@"Identifier.Issn"]) Modified: trunk/bibdesk/BDSKMARCParser.m =================================================================== --- trunk/bibdesk/BDSKMARCParser.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKMARCParser.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -372,7 +372,6 @@ NSMutableDictionary *pubDict = [[NSMutableDictionary alloc] init]; NSMutableString *formattedString = [[NSMutableString alloc] init]; NSArray *nodes, *subnodes; - NSXMLNode *node, *subnode; NSString *value, *tag, *subTag, *ind1, *ind2; nodes = [record nodesForXPath:@"./marc:leader" error:NULL]; @@ -379,7 +378,7 @@ if ([nodes count] == 0) nodes = [record nodesForXPath:@"./leader" error:NULL]; if ([nodes count]) { - node = [nodes lastObject]; + NSXMLNode *node = [nodes lastObject]; value = [node stringValue]; //tag = [node stringValueOfAttribute:@"tag"]; [formattedString appendStrings:@"LDR ", value, @"\n", nil]; @@ -388,7 +387,7 @@ nodes = [record nodesForXPath:@"./marc:controlfield" error:NULL]; if ([nodes count] == 0) nodes = [record nodesForXPath:@"./controlfield" error:NULL]; - for (node in nodes) { + for (NSXMLNode *node in nodes) { value = [node stringValue]; tag = [node stringValueOfAttribute:@"tag"]; [formattedString appendStrings:tag, @" ", value, @"\n", nil]; @@ -397,7 +396,7 @@ nodes = [record nodesForXPath:@"./marc:datafield" error:NULL]; if ([nodes count] == 0) nodes = [record nodesForXPath:@"./datafield" error:NULL]; - for (node in nodes) { + for (NSXMLNode *node in nodes) { tag = [node stringValueOfAttribute:@"tag"]; ind1 = [node stringValueOfAttribute:@"ind1"] ?: @" "; ind2 = [node stringValueOfAttribute:@"ind2"] ?: @" "; @@ -406,7 +405,7 @@ subnodes = [node nodesForXPath:@"./marc:subfield" error:NULL]; if ([subnodes count] == 0) subnodes = [node nodesForXPath:@"./subfield" error:NULL]; - for (subnode in subnodes) { + for (NSXMLNode *subnode in subnodes) { value = [subnode stringValue]; subTag = [subnode stringValueOfAttribute:@"code"]; [formattedString appendStrings:@" ", @"$", subTag, @" " , value, nil]; Modified: trunk/bibdesk/BDSKSearchBookmarkController.m =================================================================== --- trunk/bibdesk/BDSKSearchBookmarkController.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKSearchBookmarkController.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -525,10 +525,9 @@ return YES; } else { NSArray *fileURLs = [pboard readFileURLsOfTypes:@[@"net.sourceforge.bibdesk.bdsksearch"]]; - NSURL *fileURL; if ([fileURLs count] > 0) { if (idx == NSOutlineViewDropOnItemIndex && [item bookmarkType] == BDSKSearchBookmarkTypeBookmark) { - fileURL = [fileURLs objectAtIndex:0]; + NSURL *fileURL = [fileURLs objectAtIndex:0]; NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithContentsOfURL:fileURL]; if (dict) { NSDictionary *oldInfo = [item info]; @@ -540,7 +539,7 @@ if (idx == NSOutlineViewDropOnItemIndex) idx = [[item children] count]; NSMutableArray *newBookmarks = [NSMutableArray array]; - for (fileURL in fileURLs) { + for (NSURL *fileURL in fileURLs) { NSDictionary *dict = [NSDictionary dictionaryWithContentsOfURL:fileURL]; if (dict) { NSString *label = [[fileURL lastPathComponent] stringByDeletingPathExtension]; Modified: trunk/bibdesk/BDSKSearchGroup.m =================================================================== --- trunk/bibdesk/BDSKSearchGroup.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKSearchGroup.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -348,7 +348,6 @@ NSString *path = [bdsksearchURL path]; NSString *aDatabase = nil; NSString *aName = [[bdsksearchURL parameterString] stringByRemovingPercentEncoding]; - NSString *query = [bdsksearchURL query]; NSString *aSearchTerm = nil; NSString *aType = BDSKSearchGroupZoom; NSMutableDictionary *options = [NSMutableDictionary dictionary]; @@ -375,7 +374,7 @@ aType = BDSKSearchGroupDBLP; } - for (query in [query componentsSeparatedByString:@"&"]) { + for (NSString *query in [[bdsksearchURL query] componentsSeparatedByString:@"&"]) { NSUInteger idx = [query rangeOfString:@"="].location; if (idx != NSNotFound && idx > 0) { NSString *key = [query substringToIndex:idx]; Modified: trunk/bibdesk/BDSKSharingBrowser.m =================================================================== --- trunk/bibdesk/BDSKSharingBrowser.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKSharingBrowser.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -165,18 +165,16 @@ [unresolvedNetServices removeObject:aNetService]; }else{ NSString *name = [aNetService name]; - BDSKSharingClient *client = nil; // find the client we should remove - for (client in sharingClients) { - if ([[client name] isEqualToString:name]) - break; + for (BDSKSharingClient *client in sharingClients) { + if ([[client name] isEqualToString:name]) { + [client terminate]; + [sharingClients removeObject:client]; + [[NSNotificationCenter defaultCenter] postNotificationName:BDSKSharingClientsChangedNotification object:self]; + return; + } } - if (client != nil) { - [client terminate]; - [sharingClients removeObject:client]; - [[NSNotificationCenter defaultCenter] postNotificationName:BDSKSharingClientsChangedNotification object:self]; - } } } Modified: trunk/bibdesk/BDSKTask.m =================================================================== --- trunk/bibdesk/BDSKTask.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKTask.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -257,9 +257,8 @@ if (environment) { // fill with pointers to copied C strings env = calloc([environment count] + 1, sizeof(char *)); - NSString *key; NSUInteger envIndex = 0; - for (key in environment) { + for (NSString *key in environment) { env[envIndex++] = __BDSKCopyFileSystemRepresentation([NSString stringWithFormat:@"%@=%@", key, [environment objectForKey:key]]); } env[envIndex] = NULL; Modified: trunk/bibdesk/BDSKTemplate.m =================================================================== --- trunk/bibdesk/BDSKTemplate.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKTemplate.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -402,12 +402,11 @@ // accesses the node array in prefs + (BDSKTemplate *)templateForStyle:(NSString *)styleName; { - id aNode = nil; - for (aNode in [self exportTemplates]) { + for (id aNode in [self exportTemplates]) { if (NO == [aNode isLeaf] && [[aNode valueForKey:BDSKTemplateNameString] isEqualToString:styleName]) - break; + return aNode; } - return aNode; + return nil; } + (BDSKTemplate *)templateForCiteService; @@ -687,12 +686,11 @@ NSParameterAssert(nil != role); // assume roles are unique by grabbing the first one; this works for any case except the accessory files - id aNode = nil; - for (aNode in [self children]) { + for (id aNode in [self children]) { if ([[aNode valueForKey:BDSKTemplateRoleString] isEqualToString:role]) - break; + return aNode; } - return aNode; + return nil; } - (void)setRepresentedFileURL:(NSURL *)aURL; Modified: trunk/bibdesk/BDSKTemplateDocument.m =================================================================== --- trunk/bibdesk/BDSKTemplateDocument.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKTemplateDocument.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -325,7 +325,6 @@ NSArray *defaultItemTemplate = [templateDict objectForKey:@""]; NSArray *itemTemplate; BDSKTypeTemplate *template; - NSString *type; NSArray *currentTypes = [typeTemplates valueForKey:@"pubType"]; NSArray *types = [templateDict allKeys]; NSString *defaultType = nil; @@ -353,7 +352,7 @@ [typeTemplates setValue:nil forKey:@"itemTemplate"]; [typeTemplates setValue:@NO forKey:@"included"]; - for (type in types) { + for (NSString *type in types) { NSUInteger currentIndex = [currentTypes indexOfObject:type]; if (currentIndex == NSNotFound) { currentIndex = [typeTemplates count]; @@ -559,7 +558,6 @@ NSMutableString *mutString = [NSMutableString string]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"included = 1"]; NSArray *includedTemplates = [typeTemplates filteredArrayUsingPredicate:predicate]; - BDSKTypeTemplate *template; NSString *altPrefix = @""; BOOL isSimple = [includedTemplates count] == 0 || ([includedTemplates count] == 1 && [typeTemplates objectAtIndex:defaultTypeIndex] == [includedTemplates lastObject]); @@ -571,7 +569,7 @@ if (isSimple) { [mutString appendString:[[typeTemplates objectAtIndex:defaultTypeIndex] string]]; } else { - for (template in includedTemplates) { + for (BDSKTypeTemplate *template in includedTemplates) { [mutString appendFormat:@"<%@$pubType=%@?>\n", altPrefix, [template pubType]]; [mutString appendString:[template string]]; altPrefix = @"?"; @@ -600,7 +598,6 @@ if (richText) { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"included = 1"]; NSArray *includedTemplates = [typeTemplates filteredArrayUsingPredicate:predicate]; - BDSKTypeTemplate *template; NSString *altPrefix = @""; BOOL isSimple = [includedTemplates count] == 0 || ([includedTemplates count] == 1 && [typeTemplates objectAtIndex:defaultTypeIndex] == [includedTemplates lastObject]); @@ -625,7 +622,7 @@ if (isSimple) { [attrString appendAttributedString:[[typeTemplates objectAtIndex:defaultTypeIndex] attributedStringWithDefaultAttributes:attrs]]; } else { - for (template in includedTemplates) { + for (BDSKTypeTemplate *template in includedTemplates) { NSString *s = [NSString stringWithFormat:@"<%@$pubType=%@?>\n", altPrefix, [template pubType]]; [attrString appendAttributedString:[[NSAttributedString alloc] initWithString:s attributes:attrs]]; [attrString appendAttributedString:[template attributedStringWithDefaultAttributes:attrs]]; Modified: trunk/bibdesk/BDSKTemplateObjectProxy.m =================================================================== --- trunk/bibdesk/BDSKTemplateObjectProxy.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BDSKTemplateObjectProxy.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -124,8 +124,6 @@ } - (id)publicationsUsingTemplate{ - BibItem *pub = nil; - BDSKPRECONDITION(nil != template); BDSKTemplateFormat format = [template templateFormat]; id returnString = nil; @@ -135,7 +133,7 @@ if (format & BDSKTemplateFormatPlainText) { returnString = [NSMutableString stringWithString:@""]; - for (pub in [self publications]){ + for (BibItem *pub in [self publications]){ @autoreleasepool { NSArray *parsedTemplate = [parsedTemplates objectForKey:[pub pubType]]; if (parsedTemplate == nil) { @@ -162,7 +160,7 @@ } else if (format & BDSKTemplateFormatRichText) { returnString = [[NSMutableAttributedString alloc] init]; - for (pub in [self publications]){ + for (BibItem *pub in [self publications]){ @autoreleasepool { NSArray *parsedTemplate = [parsedTemplates objectForKey:[pub pubType]]; if (parsedTemplate == nil) { Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BibDocument.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -2047,13 +2047,12 @@ [bibString appendString:[[BDSKMacroResolver defaultMacroResolver] bibTeXString]]; [bibString appendString:[aMacroResolver bibTeXString]]; - BibItem *aPub = nil; BibItem *aParent = nil; NSMutableArray *selItems = [[NSMutableArray alloc] initWithCapacity:numberOfPubs]; NSMutableSet *parentItems = [[NSMutableSet alloc] initWithCapacity:numberOfPubs]; NSMutableArray *selParentItems = [[NSMutableArray alloc] initWithCapacity:numberOfPubs]; - for (aPub in items) { + for (BibItem *aPub in items) { [selItems addObject:aPub]; if(aParent = [aPub crossrefParent]) @@ -2060,7 +2059,7 @@ [parentItems addObject:aParent]; } - for (aPub in selItems) { + for (BibItem *aPub in selItems) { if([parentItems containsObject:aPub]){ [parentItems removeObject:aPub]; [selParentItems addObject:aPub]; @@ -2069,11 +2068,11 @@ } } - for (aPub in selParentItems) { + for (BibItem *aPub in selParentItems) { [bibString appendString:[aPub bibTeXStringWithOptions:options]]; } - for (aPub in parentItems) { + for (BibItem *aPub in parentItems) { [bibString appendString:[aPub bibTeXStringWithOptions:options]]; } @@ -2161,13 +2160,12 @@ } - (void)importPublications:(NSArray *)newPubs publicationsToAutoFile:(NSArray *)pubsToAutoFile options:(BDSKImportOptions)options { - BibItem *pub; NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; // set Date-Added to the current date, since unarchived items will have their own (incorrect) date NSDate *importDate = [NSDate date]; NSString *importDateDescription = [importDate standardDescription]; - for (pub in newPubs) + for (BibItem *pub in newPubs) [pub markNewWithDate:importDate description:importDateDescription]; if ((options & BDSKImportSelectLibrary)) @@ -2180,7 +2178,7 @@ NSMutableArray *autogeneratePubs = [NSMutableArray arrayWithCapacity:[newPubs count]]; BOOL hasDuplicateCiteKey = NO; - for (pub in newPubs) { + for (BibItem *pub in newPubs) { if ((autoGenerate ? [pub canAutogenerateCiteKey] : [pub hasEmptyOrDefaultCiteKey])) [autogeneratePubs addObject:pub]; else if ([pub isValidCiteKey:[pub citeKey]] == NO) @@ -2191,7 +2189,7 @@ BOOL useLocalUrlAndUrl = [sud boolForKey:BDSKUseLocalUrlAndUrlKey]; - for (pub in pubsToAutoFile) { + for (BibItem *pub in pubsToAutoFile) { if (useLocalUrlAndUrl) { [pub autoFileLocalUrl]; } else { @@ -2205,7 +2203,7 @@ BDSKDownloadOption dlOptions = BDSKDownloadCheckType; if ([sud boolForKey:BDSKReplaceDownloadedURLsKey]) options |= BDSKDownloadReplace; - for (pub in newPubs) { + for (BibItem *pub in newPubs) { if (useLocalUrlAndUrl) { if ([pub canDownloadURLForField:BDSKUrlString] && [NSString isEmptyString:[pub valueOfField:BDSKLocalUrlString inherit:NO]] && [types containsObject:[[[pub remoteURLForField:BDSKUrlString] pathExtension] lowercaseString] ?: @""]) [pub downloadURLForField:BDSKUrlString options:dlOptions]; Modified: trunk/bibdesk/BibDocument_DataSource.m =================================================================== --- trunk/bibdesk/BibDocument_DataSource.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BibDocument_DataSource.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -1245,9 +1245,8 @@ } else if ([item groupType] == BDSKWebGroupType && [pboard canReadFileURLOfTypes:nil] == NO) { NSArray *urls = [pboard readURLs]; - NSURL *url = nil; - for (url in urls) { + for (NSURL *url in urls) { if ([url isFileURL] == NO) { [(BDSKWebGroup *)item setURL:url]; return YES; @@ -1320,15 +1319,15 @@ BDSKGroupType groupType = [item groupType]; // if dropping on the static group parent, create a new static groups using a common author name or keyword if available if (groupType == BDSKStaticParentGroupType) { - BibItem *pub = [pubs lastObject]; + BibItem *aPub = [pubs lastObject]; NSHashTable *auths = [[NSHashTable alloc] initWithPointerFunctions:[NSPointerFunctions fuzzyAuthorPointerFunctions] capacity:0]; - NSHashTable *keywords = [[pub groupsForField:BDSKKeywordsString] copy]; + NSHashTable *keywords = [[aPub groupsForField:BDSKKeywordsString] copy]; - for (NSArray *array in [[pub people] allValues]) { + for (NSArray *array in [[aPub people] allValues]) { for (BibAuthor *author in array) [auths addObject:author]; } - for (pub in pubs) { + for (BibItem *pub in pubs) { if ([auths count]) { NSHashTable *pubAuths = [[NSHashTable alloc] initWithPointerFunctions:[NSPointerFunctions fuzzyAuthorPointerFunctions] capacity:0]; for (NSArray *array in [[pub people] allValues]) { @@ -1628,11 +1627,9 @@ return; NSMutableArray *files = [NSMutableArray array]; - BDSKLinkedFile *aFile; - NSURL *aURL; - for (aURL in absoluteURLs) { - aFile = [BDSKLinkedFile linkedFileWithURL:aURL delegate:publication]; + for (NSURL *aURL in absoluteURLs) { + BDSKLinkedFile *aFile = [BDSKLinkedFile linkedFileWithURL:aURL delegate:publication]; if (aFile == nil) { NSBeep(); return; @@ -1642,11 +1639,11 @@ [publication insertFiles:files atIndexes:aSet]; - for (aURL in absoluteURLs) + for (NSURL *aURL in absoluteURLs) [self userAddedURL:aURL forPublication:publication]; if (([NSEvent standardModifierFlags] & NSEventModifierFlagCommand) == 0) { - for (aFile in files) { + for (BDSKLinkedFile *aFile in files) { if ([aFile isFile]) [publication autoFileLinkedFile:aFile]; } Modified: trunk/bibdesk/BibDocument_UI.m =================================================================== --- trunk/bibdesk/BibDocument_UI.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BibDocument_UI.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -869,10 +869,9 @@ } }else if([tcId isCitationField]){ NSMutableArray *linkedPubs = [NSMutableArray array]; - BibItem *pub; - for (pub in [self clickedOrSelectedPublications]) + for (BibItem *pub in [self clickedOrSelectedPublications]) [linkedPubs addObjectsFromArray:[pub citationValueOfField:tcId]]; - for (pub in linkedPubs) { + for (BibItem *pub in linkedPubs) { item = [menu addItemWithTitle:[pub citeKey] action:@selector(editRepresentedPub:) keyEquivalent:@""]; [item setTarget:self]; [item setRepresentedObject:pub]; Modified: trunk/bibdesk/BibItem.m =================================================================== --- trunk/bibdesk/BibItem.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BibItem.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -1657,14 +1657,12 @@ if ((url = [self remoteURLForField:BDSKUrlString])) [mutableArray addObject:[url absoluteString]]; } else { - BDSKLinkedFile *file; - - for (file in [self localFiles]) { + for (BDSKLinkedFile *file in [self localFiles]) { if ((url = [file URL])) [mutableArray addObject:[url absoluteString]]; } - for (file in [self remoteURLs]) { + for (BDSKLinkedFile *file in [self remoteURLs]) { if ((url = [file URL])) [mutableArray addObject:[url absoluteString]]; } @@ -1772,7 +1770,6 @@ NSMutableSet *knownKeys = nil; NSSet *urlKeys = nil; NSSet *fileKeys = nil; - NSString *field; NSString *value; NSMutableData *data = [NSMutableData dataWithCapacity:200]; NSError *error = nil; @@ -1791,7 +1788,7 @@ // add fields to be written regardless; this is a seldom-used hack for some crossref problems // @@ added here for sorting; the original code required the user to also add this in the default fields list, but I'm not sure if that's a distinction worth preserving since it's only a hidden pref if ([fieldsToWriteIfEmpty count]) { - for (field in fieldsToWriteIfEmpty) { + for (NSString *field in fieldsToWriteIfEmpty) { if ([keys containsObject:field] == NO) [keys addObject:field]; } @@ -1834,7 +1831,7 @@ NSData *fieldValueSeparator = [@" = " dataUsingEncoding:encoding]; NSUInteger numFields = 0; - for (field in keys) { + for (NSString *field in keys) { if (isOK == NO) break; @@ -2215,11 +2212,9 @@ node = [NSXMLNode elementWithName:@"contributors"]; - BibAuthor *author; - node2 = [NSXMLNode elementWithName:@"authors"]; if ([authorField isPersonField]) { - for (author in [self peopleArrayForField:authorField]) { + for (BibAuthor *author in [self peopleArrayForField:authorField]) { value = [author normalizedName]; if ([value length] && [value characterAtIndex:0] == '{' && [value characterAtIndex:[value length] - 1] == '}') value = [[value substringWithRange:NSMakeRange(1, [value length] - 2)] stringByAppendingString:@","]; @@ -2232,7 +2227,7 @@ node2 = [NSXMLNode elementWithName:@"secondary-authors"]; if ([editorField isPersonField]) { - for (author in [self peopleArrayForField:editorField]) { + for (BibAuthor *author in [self peopleArrayForField:editorField]) { value = [author normalizedName]; if ([value length] && [value characterAtIndex:0] == '{' && [value characterAtIndex:[value length] - 1] == '}') value = [[value substringWithRange:NSMakeRange(1, [value length] - 2)] stringByAppendingString:@","]; @@ -2245,7 +2240,7 @@ node2 = [NSXMLNode elementWithName:@"subsidiary-authors"]; if ([organizationField isPersonField]) { - for (author in [self peopleArrayForField:organizationField]) { + for (BibAuthor *author in [self peopleArrayForField:organizationField]) { value = [author normalizedName]; if ([value length] && [value characterAtIndex:0] == '{' && [value characterAtIndex:[value length] - 1] == '}') value = [[value substringWithRange:NSMakeRange(1, [value length] - 2)] stringByAppendingString:@","]; @@ -2300,12 +2295,10 @@ AddXMLNodeForField(node, @"keyword", BDSKKeywordsString); [element addChild:node]; - BDSKLinkedFile *file; - node = [NSXMLNode elementWithName:@"urls"]; node2 = [NSXMLNode elementWithName:@"pdf-urls"]; - for (file in [self localFiles]) { + for (BDSKLinkedFile *file in [self localFiles]) { if ((value = [[file URL] absoluteString])) [node2 addChild:[NSXMLNode elementWithName:@"url" stringValue:value]]; } @@ -2312,7 +2305,7 @@ [node addChild:node2]; node2 = [NSXMLNode elementWithName:@"related-urls"]; - for (file in [self remoteURLs]) { + for (BDSKLinkedFile *file in [self remoteURLs]) { if ((value = [[file URL] absoluteString])) [node2 addChild:[NSXMLNode elementWithName:@"url" stringValue:value]]; } @@ -3829,8 +3822,7 @@ // here is another exampled of a doi regex = 10\.[0-9]+\/[a-z0-9\.\-\+\/\(\)]+; AGRegex *doiRegex = [AGRegex regexWithPattern:@"doi[:\\s/]{1,2}(10\\.[0-9]{4,}(?:\\.[0-9]+)*)[\\s/]{1,3}(\\S+)" options:AGRegexMultiline|AGRegexCaseInsensitive]; - AGRegexMatch *match; - for (match in [doiRegex findEnumeratorInString:string]) { + for (AGRegexMatch *match in [doiRegex findEnumeratorInString:string]) { if ([match groupAtIndex:1] != nil && [match groupAtIndex:2] != nil) [dois addObject:[NSString stringWithFormat:@"%@/%@", [match groupAtIndex:1], [match groupAtIndex:2]]]; } Modified: trunk/bibdesk/BibPref_Defaults.m =================================================================== --- trunk/bibdesk/BibPref_Defaults.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/BibPref_Defaults.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -84,7 +84,6 @@ - (void)resetDefaultFields { // initialize the default fields from the prefs NSArray *defaultFields = [sud stringArrayForKey:BDSKDefaultFieldsKey]; - NSString *field = nil; NSMutableDictionary *dict = nil; NSNumber *type; NSNumber *isDefault; @@ -94,7 +93,7 @@ // Add Local File fields type = [NSNumber numberWithInteger:BDSKLocalFileType]; - for (field in [sud stringArrayForKey:BDSKLocalFileFieldsKey]) { + for (NSString *field in [sud stringArrayForKey:BDSKLocalFileFieldsKey]) { isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -103,7 +102,7 @@ // Add Remote URL fields type = [NSNumber numberWithInteger:BDSKRemoteURLType]; - for (field in [sud stringArrayForKey:BDSKRemoteURLFieldsKey]) { + for (NSString *field in [sud stringArrayForKey:BDSKRemoteURLFieldsKey]) { isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -112,7 +111,7 @@ // Add Boolean fields type = [NSNumber numberWithInteger:BDSKBooleanType]; - for (field in [sud stringArrayForKey:BDSKBooleanFieldsKey]) { + for (NSString *field in [sud stringArrayForKey:BDSKBooleanFieldsKey]) { isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -121,7 +120,7 @@ // Add Tri-State fields type = [NSNumber numberWithInteger:BDSKTriStateType]; - for (field in [sud stringArrayForKey:BDSKTriStateFieldsKey]) { + for (NSString *field in [sud stringArrayForKey:BDSKTriStateFieldsKey]) { isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -130,7 +129,7 @@ // Add Rating fields type = [NSNumber numberWithInteger:BDSKRatingType]; - for (field in [sud stringArrayForKey:BDSKRatingFieldsKey]){ + for (NSString *field in [sud stringArrayForKey:BDSKRatingFieldsKey]){ isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -139,7 +138,7 @@ // Add Citation fields type = [NSNumber numberWithInteger:BDSKCitationType]; - for (field in [sud stringArrayForKey:BDSKCitationFieldsKey]) { + for (NSString *field in [sud stringArrayForKey:BDSKCitationFieldsKey]) { isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -148,7 +147,7 @@ // Add Person fields type = [NSNumber numberWithInteger:BDSKPersonType]; - for (field in [sud stringArrayForKey:BDSKPersonFieldsKey]) { + for (NSString *field in [sud stringArrayForKey:BDSKPersonFieldsKey]) { isDefault = [NSNumber numberWithBool:[defaultFields containsObject:field]]; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; [customFieldsArray addObject:dict]; @@ -158,7 +157,7 @@ // Add any remaining Textual default fields at the beginning type = [NSNumber numberWithInteger:BDSKStringType]; isDefault = @YES; - for (field in [defaultFields reverseObjectEnumerator]){ + for (NSString *field in [defaultFields reverseObjectEnumerator]){ if([customFieldsSet containsObject:field]) continue; dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:field, FIELD_KEY, type, TYPE_KEY, isDefault, DEFAULT_KEY, nil]; Modified: trunk/bibdesk/NSFileManager_BDSKExtensions.m =================================================================== --- trunk/bibdesk/NSFileManager_BDSKExtensions.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/NSFileManager_BDSKExtensions.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -159,11 +159,10 @@ - (NSURL *)latestLyXPipeURL { NSURL *appSupportURL = [self URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:NULL]; NSDirectoryEnumerator *dirEnum = [self enumeratorAtURL:appSupportURL includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey] options:NSDirectoryEnumerationSkipsSubdirectoryDescendants errorHandler:nil]; - NSURL *fileURL; NSURL *lyxPipeURL = nil; BDSKVersionNumber *version = nil; - for (fileURL in dirEnum) { + for (NSURL *fileURL in dirEnum) { NSNumber *isDir = nil; [fileURL getResourceValue:&isDir forKey:NSURLIsDirectoryKey error:NULL]; if ([isDir boolValue]) { Modified: trunk/bibdesk/NSFont_BDSKExtensions.m =================================================================== --- trunk/bibdesk/NSFont_BDSKExtensions.m 2024-10-16 09:34:44 UTC (rev 28959) +++ trunk/bibdesk/NSFont_BDSKExtensions.m 2024-10-16 16:09:46 UTC (rev 28960) @@ -165,11 +165,11 @@ systemFamilies = [[NSArray alloc] initWithObjects:systemFamily, @".SF NS Text", @".SF NS Display", nil]; else systemFamilies = [[NSArray alloc] initWithObjects:systemFamily, nil]; - for (systemFamily in systemFamilies) { - for (NSArray *fontInfo in [fm availableMembersOfFontFamily:systemFamily]) { + for (NSString *aSystemFamily in systemFamilies) { + for (NSArray *fontInfo in [fm availableMembersOfFontFamily:aSystemFamily]) { NSString *fontName = [fontInfo objectAtIndex:0]; NSMutableArray *names = [NSMutableArray arrayWithObjects:baseFontName, nil]; - NSString *name = [fm localizedNameForFamily:systemFamily face:[fontInfo objectAtIndex:1]]; + NSString *name = [fm localizedNameForFamily:aSystemFamily face:[fontInfo objectAtIndex:1]]; if (name) { [names addObject:name]; } else { 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