Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cleanup for MacOS target. #189

Merged
merged 4 commits into from

2 participants

This page is out of date. Refresh to see the latest.
View
4 Core/Source/DTCSSStylesheet.m
@@ -222,7 +222,7 @@ - (void)parseStyleBlock:(NSString*)css
NSString* selector;
- NSInteger length = [css length];
+ NSUInteger length = [css length];
for (NSUInteger i = 0; i < length; i++) {
@@ -285,7 +285,7 @@ - (void)parseStyleBlock:(NSString*)css
braceMarker = i + 1;
}
- braceLevel = MAX(braceLevel-1, 0);
+ braceLevel = MAX(braceLevel-1, 0ul);
}
}
}
View
4 Core/Source/DTCoreText.h
@@ -1,5 +1,7 @@
#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
#endif
// global constants
@@ -30,6 +32,7 @@
#import "NSString+UTF8Cleaner.h"
#import "DTCoreTextParagraphStyle.h"
#import "NSMutableAttributedString+HTML.h"
+#import "NSAttributedString+HTML.h"
#import "NSAttributedString+SmallCaps.h"
#import "NSAttributedString+DTCoreText.h"
@@ -37,7 +40,6 @@
// These classes only work with UIKit on iOS
#if TARGET_OS_IPHONE
-#import "NSAttributedString+HTML.h"
#import "DTLazyImageView.h"
#import "DTLinkButton.h"
View
4 Core/Source/DTCoreTextFontCollection.m
@@ -9,7 +9,11 @@
#import "DTCoreTextFontCollection.h"
#import "DTCoreTextFontDescriptor.h"
+#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
@interface DTCoreTextFontCollection ()
View
4 Core/Source/DTCoreTextGlyphRun.h
@@ -8,7 +8,11 @@
+#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
@class DTCoreTextLayoutLine;
@class DTTextAttachment;
View
4 Core/Source/DTCoreTextLayoutFrame.h
@@ -7,7 +7,11 @@
//
+#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
@class DTCoreTextLayoutLine;
@class DTTextBlock;
View
4 Core/Source/DTCoreTextLayoutLine.h
@@ -7,7 +7,11 @@
//
+#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
@class DTCoreTextLayoutFrame;
View
4 Core/Source/DTCoreTextLayouter.h
@@ -8,7 +8,11 @@
+#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
#import "DTCoreTextLayoutFrame.h"
#import "DTCoreTextLayoutLine.h"
View
2  Core/Source/DTTextAttachment.h
@@ -8,6 +8,8 @@
#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
#endif
@class DTHTMLElement;
View
12 Core/Source/NSAttributedString+DTCoreText.m
@@ -116,11 +116,11 @@ - (NSInteger)itemNumberInTextList:(DTCSSListStyle *)list atIndex:(NSUInteger)loc
- (NSRange)_rangeOfObject:(id)object inArrayBehindAttribute:(NSString *)attribute atIndex:(NSUInteger)location
{
- NSInteger searchIndex = location;
+ NSUInteger searchIndex = location;
NSArray *arrayAtIndex;
- NSInteger minFoundIndex = NSIntegerMax;
- NSInteger maxFoundIndex = 0;
+ NSUInteger minFoundIndex = NSUIntegerMax;
+ NSUInteger maxFoundIndex = 0;
BOOL foundList = NO;
@@ -348,7 +348,7 @@ - (NSString *)htmlString
NSArray *previousListStyles = nil;
- for (int i=0; i<[paragraphs count]; i++)
+ for (NSUInteger i=0; i<[paragraphs count]; i++)
{
NSString *oneParagraph = [paragraphs objectAtIndex:i];
NSRange paragraphRange = NSMakeRange(location, [oneParagraph length]);
@@ -748,7 +748,7 @@ - (NSString *)plainTextString
return [tmpString stringByReplacingOccurrencesOfString:UNICODE_OBJECT_PLACEHOLDER withString:@""];
}
-#pragma Generating Special Attributed Strings
+#pragma mark Generating Special Attributed Strings
+ (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter listStyle:(DTCSSListStyle *)listStyle listIndent:(CGFloat)listIndent attributes:(NSDictionary *)attributes
{
// get existing values from attributes
@@ -794,7 +794,7 @@ + (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter lis
fontDesc.boldTrait = NO;
fontDesc.italicTrait = NO;
- CTFontRef font = [fontDesc newMatchingFont];
+ font = [fontDesc newMatchingFont];
[newAttributes setObject:CFBridgingRelease(font) forKey:(id)kCTFontAttributeName];
}
View
5 Core/Source/NSAttributedString+HTML.m
@@ -6,7 +6,11 @@
// Copyright 2011 Drobnik.com. All rights reserved.
//
+#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
#import "DTCoreTextConstants.h"
@@ -17,7 +21,6 @@
#import "DTColor+HTML.h"
#import "NSScanner+HTML.h"
#import "NSCharacterSet+HTML.h"
-#import "NSAttributedStringRunDelegates.h"
#import "DTTextAttachment.h"
#import "DTHTMLElement.h"
View
2  Core/Source/NSAttributedStringRunDelegates.h
@@ -8,6 +8,8 @@
#if TARGET_OS_IPHONE
#import <CoreText/CoreText.h>
+#elif TARGET_OS_MAC
+#import <ApplicationServices/ApplicationServices.h>
#endif
void embeddedObjectDeallocCallback(void *context);
View
2  Core/Source/NSData+DTBase64.m
@@ -101,7 +101,7 @@
size_t accumulateIndex = 0;
while (i < length)
{
- unsigned char decode = base64DecodeLookup[inputBuffer[i++]];
+ unsigned char decode = base64DecodeLookup[(int) inputBuffer[i++]];
if (decode != xx)
{
accumulated[accumulateIndex] = decode;
Something went wrong with that request. Please try again.