Revision: 29322
http://sourceforge.net/p/bibdesk/svn/29322
Author: hofman
Date: 2025-07-22 09:07:22 +0000 (Tue, 22 Jul 2025)
Log Message:
-----------
do not check changes to inherited values for bibitem updates to uninherited keys
Modified Paths:
--------------
trunk/bibdesk/BibDocument_UI.m
Modified: trunk/bibdesk/BibDocument_UI.m
===================================================================
--- trunk/bibdesk/BibDocument_UI.m 2025-07-22 08:50:10 UTC (rev 29321)
+++ trunk/bibdesk/BibDocument_UI.m 2025-07-22 09:07:22 UTC (rev 29322)
@@ -1455,37 +1455,39 @@
citeFields = [typeManager citationFieldsSet];
}
- for (BibItem *aPub in publications) {
- NSString *crossref = [aPub valueOfField:BDSKCrossrefString inherit:NO];
-
- // invalidate groups that depend on inherited values
- if ([NSString isEmptyString:crossref] == NO && [key
isCaseInsensitiveEqual:crossref]) {
- [aPub resetGroups];
- // inherited fields are also searched
- if (shouldReindex)
- [publications reindexPublication:aPub];
- [changedPublications addObject:aPub];
- // all inherited fields could change when parent is created, needs
full UI update
- if ([changedKey isEqualToString:BDSKCiteKeyString])
- changedKey = nil;
- }
-
- // change the crossrefs if we change the parent cite key
- if (oldKey) {
- if ([oldKey isCaseInsensitiveEqual:crossref])
- [aPub setField:BDSKCrossrefString toValue:key];
+ if ([changedKey isNoteField] == NO && [changedKey isGeneralURLField] == NO
&& [changedKey isIntegerField] == NO && [changedKey
isEqualToString:BDSKPubTypeString] == NO) {
+ for (BibItem *aPub in publications) {
+ NSString *crossref = [aPub valueOfField:BDSKCrossrefString
inherit:NO];
- for (NSString *field in citeFields) {
- NSString *value = [aPub valueOfField:field inherit:NO];
- // value may be nil, so check before calling rangeOfString:
- if (nil != value) {
- NSRange range = [value rangeOfString:oldKey];
- if (range.location != NSNotFound &&
- (range.location == 0 || [invalidSet
characterIsMember:[value characterAtIndex:range.location]]) &&
- (NSMaxRange(range) == [value length] || [invalidSet
characterIsMember:[value characterAtIndex:NSMaxRange(range)]])) {
- NSMutableString *tmpString = [value mutableCopy];
- [tmpString replaceCharactersInRange:range
withString:key];
- [aPub setField:field toValue:tmpString];
+ // invalidate groups that depend on inherited values
+ if ([NSString isEmptyString:crossref] == NO && [key
isCaseInsensitiveEqual:crossref]) {
+ [aPub resetGroups];
+ // inherited fields are also searched
+ if (shouldReindex)
+ [publications reindexPublication:aPub];
+ [changedPublications addObject:aPub];
+ // all inherited fields could change when parent is created,
needs full UI update
+ if ([changedKey isEqualToString:BDSKCiteKeyString])
+ changedKey = nil;
+ }
+
+ // change the crossrefs if we change the parent cite key
+ if (oldKey) {
+ if ([oldKey isCaseInsensitiveEqual:crossref])
+ [aPub setField:BDSKCrossrefString toValue:key];
+
+ for (NSString *field in citeFields) {
+ NSString *value = [aPub valueOfField:field inherit:NO];
+ // value may be nil, so check before calling rangeOfString:
+ if (nil != value) {
+ NSRange range = [value rangeOfString:oldKey];
+ if (range.location != NSNotFound &&
+ (range.location == 0 || [invalidSet
characterIsMember:[value characterAtIndex:range.location]]) &&
+ (NSMaxRange(range) == [value length] ||
[invalidSet characterIsMember:[value characterAtIndex:NSMaxRange(range)]])) {
+ NSMutableString *tmpString = [value mutableCopy];
+ [tmpString replaceCharactersInRange:range
withString:key];
+ [aPub setField:field toValue:tmpString];
+ }
}
}
}
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