Revision: 26703 http://sourceforge.net/p/bibdesk/svn/26703 Author: hofman Date: 2021-08-20 14:14:04 +0000 (Fri, 20 Aug 2021) Log Message: ----------- assert value class and possibly view class
Modified Paths: -------------- trunk/bibdesk/BibDocument_DataSource.m Modified: trunk/bibdesk/BibDocument_DataSource.m =================================================================== --- trunk/bibdesk/BibDocument_DataSource.m 2021-08-20 13:55:00 UTC (rev 26702) +++ trunk/bibdesk/BibDocument_DataSource.m 2021-08-20 14:14:04 UTC (rev 26703) @@ -119,6 +119,8 @@ NSImageView *imageView = [view imageView]; if (textField == nil && imageView == nil) { // special field types displayed using a button or level indicator + BDSKASSERT([view isKindOfClass:[BDSKControlTableCellView class]]); + BDSKASSERT(value == nil || [value isKindOfClass:[NSNumber class]]); NSControl *control = [(BDSKControlTableCellView *)view control]; if ([tcID isEqualToString:BDSKImportOrderString]) { if ([pub isImported]) { @@ -142,6 +144,7 @@ [control setObjectValue:value]; } else if (imageView == nil) { // generic text field + // value can be an NSNumber for Item Number // possibly reset red color from invalid cite key, can be reused for any text field if ([tcID isEqualToString:BDSKCiteKeyString] && [pub isValidCiteKey:[pub citeKey]] == NO) [textField setTextColor:[NSColor systemRedColor]]; @@ -150,11 +153,13 @@ [textField setObjectValue:value]; } else if (textField == nil) { // URL field + BDSKASSERT(value == nil || [value isKindOfClass:[NSImage class]]); NSURL *url = [pub URLForField:tcID]; [imageView setToolTip:[url isFileURL] ? [[url path] stringByAbbreviatingWithTildeInPath] : [url absoluteString]]; [imageView setObjectValue:value]; } else { // linked files and URLs + BDSKASSERT(value == nil || [value isKindOfClass:[NSDictionary class]]); [view setToolTip:[value valueForKey:@"toolTip"]]; [textField setObjectValue:[value valueForKey:@"string"]]; [imageView setObjectValue:[value valueForKey:@"image"]]; 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