From 461756bc0939fdcac23bb6d61e4f1296c8d3fb66 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Mon, 18 Feb 2013 15:34:31 +0100 Subject: [PATCH] Avoid typecasts --- Frameworks/layout/src/ct.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frameworks/layout/src/ct.cc b/Frameworks/layout/src/ct.cc index 050e6d60..4a38215c 100644 --- a/Frameworks/layout/src/ct.cc +++ b/Frameworks/layout/src/ct.cc @@ -108,8 +108,8 @@ namespace ct CFAttributedStringSetAttribute(str, CFRangeMake(0, CFAttributedStringGetLength(str)), kCTForegroundColorAttributeName, textColor ?: styles.foreground()); CFAttributedStringSetAttribute(str, CFRangeMake(0, CFAttributedStringGetLength(str)), kCTLigatureAttributeName, cf::wrap(0)); if(styles.underlined()) - _underlines.push_back(std::make_pair(CFRangeMake(CFAttributedStringGetLength(toDraw), CFAttributedStringGetLength(str)), CGColorPtr((CGColorRef)CFRetain(styles.foreground()), CFRelease))); - _backgrounds.push_back(std::make_pair(CFRangeMake(CFAttributedStringGetLength(toDraw), CFAttributedStringGetLength(str)), CGColorPtr((CGColorRef)CFRetain(styles.background()), CFRelease))); + _underlines.push_back(std::make_pair(CFRangeMake(CFAttributedStringGetLength(toDraw), CFAttributedStringGetLength(str)), CGColorPtr(CGColorRetain(styles.foreground()), CGColorRelease))); + _backgrounds.push_back(std::make_pair(CFRangeMake(CFAttributedStringGetLength(toDraw), CFAttributedStringGetLength(str)), CGColorPtr(CGColorRetain(styles.background()), CGColorRelease))); CFAttributedStringReplaceAttributedString(toDraw, CFRangeMake(CFAttributedStringGetLength(toDraw), 0), str); CFRelease(str); }