X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FChapterTitles.m;h=893c2dc22321d1cf89b7d8ba3bca3ca42d85e361;hb=f35d39f9adca67471b72f3e47398855d51481f87;hp=cc2d50c233e75efc9feea1203783de33336b98ec;hpb=39e4bc5bb03e56aa33ab7c2252a6cbc5dc1db09a;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/ChapterTitles.m b/macosx/ChapterTitles.m index cc2d50c2..893c2dc2 100644 --- a/macosx/ChapterTitles.m +++ b/macosx/ChapterTitles.m @@ -61,25 +61,28 @@ - (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn - row:(int)rowIndex + row:(NSInteger)rowIndex { if(aTableColumn != nil && [[aTableColumn identifier] intValue] == 2) { - hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex ); - - if( chapter != NULL ) + if( fTitle ) { - strncpy( chapter->title, [anObject UTF8String], 1023); - chapter->title[1023] = '\0'; + hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex ); + + if( chapter != NULL ) + { + strncpy( chapter->title, [anObject UTF8String], 1023); + chapter->title[1023] = '\0'; + } } } } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn - row:(int)rowIndex + row:(NSInteger)rowIndex { - NSString *cellEntry; + NSString *cellEntry = @"__DATA ERROR__"; if([[aTableColumn identifier] intValue] == 1) { @@ -87,18 +90,17 @@ } else { - hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex ); - - if( chapter != NULL ) + if( fTitle ) { - cellEntry = [NSString stringWithUTF8String:chapter->title]; - } - else - { - cellEntry = @"__DATA ERROR__"; + hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex ); + + if( chapter != NULL ) + { + cellEntry = [NSString stringWithUTF8String:chapter->title]; + } } } - + return cellEntry; } @@ -109,11 +111,11 @@ a timer to avoid interfering with the chain of events that handles the edit. */ NSTableView *chapterTable = [notification object]; NSInteger column = [chapterTable editedColumn]; NSInteger row = [chapterTable editedRow]; - int textMovement; + NSInteger textMovement; // Edit the cell in the next row, same column row++; - textMovement = [[[notification userInfo] objectForKey:@"NSTextMovement"] intValue]; + textMovement = [[[notification userInfo] objectForKey:@"NSTextMovement"] integerValue]; if( textMovement == NSReturnTextMovement && row < [chapterTable numberOfRows] ) { NSArray *info = [NSArray arrayWithObjects:chapterTable,