From 69870956666618aa5c8194abf6fb2967fa14d064 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 8 Jun 2017 14:51:06 +1000 Subject: Indented consistently by using astyle. --- cocoa/QuartzTextStyle.h | 54 ++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) (limited to 'cocoa/QuartzTextStyle.h') diff --git a/cocoa/QuartzTextStyle.h b/cocoa/QuartzTextStyle.h index 12cc0e0b2..8572f5270 100644 --- a/cocoa/QuartzTextStyle.h +++ b/cocoa/QuartzTextStyle.h @@ -10,72 +10,60 @@ #include "QuartzTextStyleAttribute.h" -class QuartzTextStyle -{ +class QuartzTextStyle { public: - QuartzTextStyle() - { + QuartzTextStyle() { fontRef = NULL; styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); characterSet = 0; } - QuartzTextStyle(const QuartzTextStyle &other) - { + QuartzTextStyle(const QuartzTextStyle &other) { // Does not copy font colour attribute fontRef = static_cast(CFRetain(other.fontRef)); styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); characterSet = other.characterSet; } - ~QuartzTextStyle() - { - if (styleDict != NULL) - { + ~QuartzTextStyle() { + if (styleDict != NULL) { CFRelease(styleDict); styleDict = NULL; } - if (fontRef) - { + if (fontRef) { CFRelease(fontRef); fontRef = NULL; } } - CFMutableDictionaryRef getCTStyle() const - { + CFMutableDictionaryRef getCTStyle() const { return styleDict; } - void setCTStyleColor(CGColor *inColor) - { + void setCTStyleColor(CGColor *inColor) { CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor); } - float getAscent() const - { + float getAscent() const { return static_cast(::CTFontGetAscent(fontRef)); } - float getDescent() const - { + float getDescent() const { return static_cast(::CTFontGetDescent(fontRef)); } - float getLeading() const - { + float getLeading() const { return static_cast(::CTFontGetLeading(fontRef)); } - void setFontRef(CTFontRef inRef, int characterSet_) - { + void setFontRef(CTFontRef inRef, int characterSet_) { fontRef = inRef; characterSet = characterSet_; @@ -83,19 +71,17 @@ public: CFRelease(styleDict); styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); } - CTFontRef getFontRef() - { + CTFontRef getFontRef() { return fontRef; } - int getCharacterSet() - { + int getCharacterSet() { return characterSet; } -- cgit v1.2.3