summaryrefslogtreecommitdiff
path: root/cocoa/PSMTabBarControl/NSString_AITruncation.m
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-01-26 10:52:13 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-01-26 10:52:13 +0000
commit7b2694e9f6c35d9f50c3fb3cf38b0fc766478162 (patch)
treec4e3d07a6bb51de884f53312a96d05849f072db1 /cocoa/PSMTabBarControl/NSString_AITruncation.m
parenta663cf8f84942e1147d1d2f3db292308639c7fa5 (diff)
downloadnetsurf-7b2694e9f6c35d9f50c3fb3cf38b0fc766478162.tar.gz
netsurf-7b2694e9f6c35d9f50c3fb3cf38b0fc766478162.tar.bz2
Updated PSMTabBarControl source code to version from https://github.com/dergraf83/PSMTabBarControl
svn path=/trunk/netsurf/; revision=11490
Diffstat (limited to 'cocoa/PSMTabBarControl/NSString_AITruncation.m')
-rw-r--r--cocoa/PSMTabBarControl/NSString_AITruncation.m14
1 files changed, 6 insertions, 8 deletions
diff --git a/cocoa/PSMTabBarControl/NSString_AITruncation.m b/cocoa/PSMTabBarControl/NSString_AITruncation.m
index 567c78f2f..1a54502e5 100644
--- a/cocoa/PSMTabBarControl/NSString_AITruncation.m
+++ b/cocoa/PSMTabBarControl/NSString_AITruncation.m
@@ -11,23 +11,21 @@
@implementation NSString (AITruncation)
-+ (id)ellipsis
-{
++ (id)ellipsis {
return [NSString stringWithUTF8String:"\xE2\x80\xA6"];
}
-- (NSString *)stringWithEllipsisByTruncatingToLength:(NSUInteger)length
-{
+- (NSString *)stringWithEllipsisByTruncatingToLength:(NSUInteger)length {
NSString *returnString;
-
- if (length < [self length]) {
+
+ if(length < [self length]) {
//Truncate and append the ellipsis
- returnString = [[self substringToIndex:length-1] stringByAppendingString:[NSString ellipsis]];
+ returnString = [[self substringToIndex:length - 1] stringByAppendingString:[NSString ellipsis]];
} else {
//We don't need to truncate, so don't append an ellipsis
returnString = [[self copy] autorelease];
}
-
+
return returnString;
}