Diff for /chimera/BookmarksService.mm between versions 1.10 and 1.11

version 1.10, 2002/02/10 03:51:31 version 1.11, 2002/02/11 10:23:03
Line 227 Line 227
   
 - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item  - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
 {  {
    if (!item)    NSMutableAttributedString   *cellValue = [[NSMutableAttributedString alloc] init];
     NSMutableAttributedString   *attachmentAttrString = nil;
     NSString                                    *columnName = [tableColumn identifier];
     NSCell                                              *attachmentCell;
 
     if ( item ) {
         NSLog(@"%@", item);
         if ([columnName isEqualToString: @"name"]) {
             nsIContent* content = [item contentNode];
             nsAutoString nameAttr;
             content->GetAttr(kNameSpaceID_None, BookmarksService::gNameAtom, nameAttr);
             nsCAutoString cStr; cStr.AssignWithConversion(nameAttr);
             
         //set cell's textual contents
             [cellValue replaceCharactersInRange:NSMakeRange(0, [cellValue length])
                                      withString:[NSString stringWithCString: cStr.get()]];
             
         //Add image to cell's text in front of the text.
             NSFileWrapper *wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:nil];
             NSTextAttachment *attachment = [[NSTextAttachment allocWithZone:NULL] initWithFileWrapper:wrapper];
             attachmentAttrString = [[NSMutableAttributedString attributedStringWithAttachment:attachment] retain];
             [attachment release];
             [wrapper release];
 
             attachmentCell = (NSCell *)[(NSTextAttachment *)[attachmentAttrString attribute:NSAttachmentAttributeName
                                                                                     atIndex:0
                                                                              effectiveRange:NULL] attachmentCell];
 
             [attachmentCell setImage:[NSImage imageNamed:@"folder"]];
             [cellValue replaceCharactersInRange:NSMakeRange(0, 0) withAttributedString:attachmentAttrString];
             [cellValue addAttribute:NSBaselineOffsetAttributeName
                               value:[NSNumber numberWithFloat:-3.0]
                               range:NSMakeRange(0, 1)];
         //Done adding image. 
         }
         return cellValue;
     } else {
         return nil;          return nil;
       
     NSString* columnName = [tableColumn identifier];  
         
     if ([columnName isEqualToString: @"name"]) {  
         nsIContent* content = [item contentNode];  
         nsAutoString nameAttr;  
         content->GetAttr(kNameSpaceID_None, BookmarksService::gNameAtom, nameAttr);  
         nsCAutoString cStr; cStr.AssignWithConversion(nameAttr);  
         return [NSString stringWithCString: cStr.get()];  
     }      }
       
     return nil;  
 }  }
   
 - (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item  - (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item

Removed from v.1.10  
changed lines
  Added in v.1.11


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>