From c7fe556fb2c34e160f92d548f291629196bfdaf4 Mon Sep 17 00:00:00 2001 From: Jeyaram Jeyaraj Date: Thu, 30 Mar 2017 10:21:37 -0700 Subject: [PATCH] Removing CoreText's NSString dependency --- Frameworks/CoreText/CTFontCollection.mm | 4 ++-- Frameworks/CoreText/CTFontManager.mm | 7 +++---- Frameworks/CoreText/CTFrame.mm | 10 +++++----- Frameworks/CoreText/CTRun.mm | 8 ++++---- Frameworks/CoreText/CTTextTab.mm | 4 ++-- Frameworks/CoreText/CTTypesetter.mm | 4 ++-- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Frameworks/CoreText/CTFontCollection.mm b/Frameworks/CoreText/CTFontCollection.mm index d23147030e..bce5397b04 100644 --- a/Frameworks/CoreText/CTFontCollection.mm +++ b/Frameworks/CoreText/CTFontCollection.mm @@ -1,6 +1,6 @@ //****************************************************************************** // -// Copyright (c) 2016 Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // // This code is licensed under the MIT License (MIT). // @@ -17,7 +17,7 @@ #import #import -const CFStringRef kCTFontCollectionRemoveDuplicatesOption = static_cast(@"kCTFontCollectionRemoveDuplicatesOption"); +const CFStringRef kCTFontCollectionRemoveDuplicatesOption = CFSTR("kCTFontCollectionRemoveDuplicatesOption"); /** @Status NotInPlan diff --git a/Frameworks/CoreText/CTFontManager.mm b/Frameworks/CoreText/CTFontManager.mm index ca013661af..56dcd48cac 100644 --- a/Frameworks/CoreText/CTFontManager.mm +++ b/Frameworks/CoreText/CTFontManager.mm @@ -20,10 +20,9 @@ #import #import -const CFStringRef kCTFontManagerRegisteredFontsChangedNotification = - static_cast(@"kCTFontManagerRegisteredFontsChangedNotification"); -const CFStringRef kCTFontManagerErrorDomain = static_cast(@"kCTFontManagerErrorDomain"); -const CFStringRef kCTFontManagerErrorFontURLsKey = static_cast(@"kCTFontManagerErrorFontURLsKey"); +const CFStringRef kCTFontManagerRegisteredFontsChangedNotification = CFSTR("kCTFontManagerRegisteredFontsChangedNotification"); +const CFStringRef kCTFontManagerErrorDomain = CFSTR("kCTFontManagerErrorDomain"); +const CFStringRef kCTFontManagerErrorFontURLsKey = CFSTR("kCTFontManagerErrorFontURLsKey"); /** @Status Stub diff --git a/Frameworks/CoreText/CTFrame.mm b/Frameworks/CoreText/CTFrame.mm index e5fe0b4424..ff56d5b4b3 100644 --- a/Frameworks/CoreText/CTFrame.mm +++ b/Frameworks/CoreText/CTFrame.mm @@ -22,11 +22,11 @@ #import "CGContextInternal.h" #import "CGPathInternal.h" -const CFStringRef kCTFrameProgressionAttributeName = static_cast(@"kCTFrameProgressionAttributeName"); -const CFStringRef kCTFramePathFillRuleAttributeName = static_cast(@"kCTFramePathFillRuleAttributeName"); -const CFStringRef kCTFramePathWidthAttributeName = static_cast(@"kCTFramePathWidthAttributeName"); -const CFStringRef kCTFrameClippingPathsAttributeName = static_cast(@"kCTFrameClippingPathsAttributeName"); -const CFStringRef kCTFramePathClippingPathAttributeName = static_cast(@"kCTFramePathClippingPathAttributeName"); +const CFStringRef kCTFrameProgressionAttributeName = CFSTR("kCTFrameProgressionAttributeName"); +const CFStringRef kCTFramePathFillRuleAttributeName = CFSTR("kCTFramePathFillRuleAttributeName"); +const CFStringRef kCTFramePathWidthAttributeName = CFSTR("kCTFramePathWidthAttributeName"); +const CFStringRef kCTFrameClippingPathsAttributeName = CFSTR("kCTFrameClippingPathsAttributeName"); +const CFStringRef kCTFramePathClippingPathAttributeName = CFSTR("kCTFramePathClippingPathAttributeName"); @implementation _CTFrame : NSObject - (instancetype)init { diff --git a/Frameworks/CoreText/CTRun.mm b/Frameworks/CoreText/CTRun.mm index 20916b8add..87df9bcfcd 100644 --- a/Frameworks/CoreText/CTRun.mm +++ b/Frameworks/CoreText/CTRun.mm @@ -29,10 +29,10 @@ #include #include -const CFStringRef kCTBackgroundStrokeColorAttributeName = static_cast(@"kCTBackgroundStrokeColorAttributeName"); -const CFStringRef kCTBackgroundFillColorAttributeName = static_cast(@"kCTBackgroundFillColorAttributeName"); -const CFStringRef kCTBackgroundCornerRadiusAttributeName = static_cast(@"kCTBackgroundCornerRadiusAttributeName"); -const CFStringRef kCTBackgroundLineWidthAttributeName = static_cast(@"kCTBackgroundLineWidthAttributeName"); +const CFStringRef kCTBackgroundStrokeColorAttributeName = CFSTR("kCTBackgroundStrokeColorAttributeName"); +const CFStringRef kCTBackgroundFillColorAttributeName = CFSTR("kCTBackgroundFillColorAttributeName"); +const CFStringRef kCTBackgroundCornerRadiusAttributeName = CFSTR("kCTBackgroundCornerRadiusAttributeName"); +const CFStringRef kCTBackgroundLineWidthAttributeName = CFSTR("kCTBackgroundLineWidthAttributeName"); @implementation _CTRun : NSObject - (void)dealloc { diff --git a/Frameworks/CoreText/CTTextTab.mm b/Frameworks/CoreText/CTTextTab.mm index f6353bd96c..1580065398 100644 --- a/Frameworks/CoreText/CTTextTab.mm +++ b/Frameworks/CoreText/CTTextTab.mm @@ -1,6 +1,6 @@ //****************************************************************************** // -// Copyright (c) 2016 Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // // This code is licensed under the MIT License (MIT). // @@ -17,7 +17,7 @@ #import #import -const CFStringRef kCTTabColumnTerminatorsAttributeName = static_cast(@"kCTTabColumnTerminatorsAttributeName"); +const CFStringRef kCTTabColumnTerminatorsAttributeName = CFSTR("kCTTabColumnTerminatorsAttributeName"); /** @Status Stub diff --git a/Frameworks/CoreText/CTTypesetter.mm b/Frameworks/CoreText/CTTypesetter.mm index 76ab5acdf7..8846c83aa8 100644 --- a/Frameworks/CoreText/CTTypesetter.mm +++ b/Frameworks/CoreText/CTTypesetter.mm @@ -25,8 +25,8 @@ static const wchar_t* TAG = L"CTTypesetter"; -const CFStringRef kCTTypesetterOptionDisableBidiProcessing = static_cast(@"kCTTypesetterOptionDisableBidiProcessing"); -const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel = static_cast(@"kCTTypesetterOptionForcedEmbeddingLevel"); +const CFStringRef kCTTypesetterOptionDisableBidiProcessing = CFSTR("kCTTypesetterOptionDisableBidiProcessing"); +const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel = CFSTR("kCTTypesetterOptionForcedEmbeddingLevel"); @implementation _CTTypesetter - (instancetype)initWithAttributedString:(NSAttributedString*)str {