From: <ho...@us...> - 2006-08-07 10:03:41
|
Revision: 7276 Author: hofman Date: 2006-08-07 03:03:36 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/bibdesk/?rev=7276&view=rev Log Message: ----------- Allow the generated citekey to change when it is invalid. Modified Paths: -------------- trunk/bibdesk/BibItem.m Modified: trunk/bibdesk/BibItem.m =================================================================== --- trunk/bibdesk/BibItem.m 2006-08-07 08:09:26 UTC (rev 7275) +++ trunk/bibdesk/BibItem.m 2006-08-07 10:03:36 UTC (rev 7276) @@ -916,8 +916,12 @@ - (NSString *)suggestedCiteKey { + NSString *suggestion = [self citeKey]; + if ([self hasEmptyOrDefaultCiteKey] || [document citeKeyIsUsed:suggestion byItemOtherThan:self]) + suggestion = nil; + NSString *citeKeyFormat = [[OFPreferenceWrapper sharedPreferenceWrapper] objectForKey:BDSKCiteKeyFormatKey]; - NSString *ck = [BDSKFormatParser parseFormat:citeKeyFormat forField:BDSKCiteKeyString ofItem:self suggestion:[self citeKey]]; + NSString *ck = [BDSKFormatParser parseFormat:citeKeyFormat forField:BDSKCiteKeyString ofItem:self suggestion:suggestion]; if ([[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKCiteKeyLowercaseKey]) { ck = [ck lowercaseString]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |