Adium

Changeset 23034

Show
Ignore:
Timestamp:
04/03/2008 11:21:13 AM (8 months ago)
Author:
evands
Message:

I see no reason to force default attributes for decoded text to Lucda Grande 12; if the incoming HTML doesn't specify a font or size, we should produce an NSAttributedString which similarly doesn't specify. Along with [23033], fixes #5561 and fixes #9524.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/Adium Framework/Source/AIHTMLDecoder.m

    r23031 r23034  
    6666@implementation AIHTMLDecoder 
    6767 
    68 static AITextAttributes *_defaultTextDecodingAttributes = nil; 
    6968static NSString                 *horizontalRule = nil; 
    7069 
    7170+ (void)initialize 
    7271{ 
    73         if (!_defaultTextDecodingAttributes) { 
    74                 _defaultTextDecodingAttributes = [[AITextAttributes textAttributesWithFontFamily:@"Lucida Grande" traits:0 size:12] retain]; 
    75         } 
    76  
    7772        //Set up the horizontal rule which will be searched-for when encoding and inserted when decoding 
    78         if (!horizontalRule) { 
     73        if ((self == [AIHTMLDecoder class])) { 
    7974#define HORIZONTAL_BAR                  0x2013 
    8075#define HORIZONTAL_RULE_LENGTH  12 
    81  
     76                 
    8277                const unichar separatorUTF16[HORIZONTAL_RULE_LENGTH] = { 
    8378                        '\n', HORIZONTAL_BAR, HORIZONTAL_BAR, HORIZONTAL_BAR, HORIZONTAL_BAR, HORIZONTAL_BAR, 
     
    10591054                textAttributes = [AITextAttributes textAttributesWithDictionary:inDefaultAttributes]; 
    10601055        } else { 
    1061                 textAttributes = [[_defaultTextDecodingAttributes copy] autorelease]; 
    1062         } 
    1063          
     1056                textAttributes = [[[AITextAttributes alloc] init] autorelease]; 
     1057        } 
     1058 
    10641059    attrString = [[NSMutableAttributedString alloc] init]; 
    10651060