src/video/cocoa/SDL_cocoaclipboard.m
changeset 6036 f2a89f2a6157
parent 5646 fe1df351ca3d
child 6044 35448a5ea044
     1.1 --- a/src/video/cocoa/SDL_cocoaclipboard.m	Sat Oct 29 23:34:19 2011 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoaclipboard.m	Sat Oct 29 23:43:59 2011 -0700
     1.3 @@ -94,24 +94,12 @@
     1.4  SDL_bool
     1.5  Cocoa_HasClipboardText(_THIS)
     1.6  {
     1.7 -    NSAutoreleasePool *pool;
     1.8 -    NSPasteboard *pasteboard;
     1.9 -    NSString *format = GetTextFormat(_this);
    1.10 -    NSString *available;
    1.11 -    SDL_bool result;
    1.12 -
    1.13 -    pool = [[NSAutoreleasePool alloc] init];
    1.14 -
    1.15 -    pasteboard = [NSPasteboard generalPasteboard];
    1.16 -    available = [pasteboard availableTypeFromArray: [NSArray arrayWithObject:format]];
    1.17 -    if ([available isEqualToString:format]) {
    1.18 -        result = SDL_TRUE;
    1.19 -    } else {
    1.20 -        result = SDL_FALSE;
    1.21 +    SDL_bool result = SDL_FALSE;
    1.22 +    char *text = Cocoa_GetClipboardText(_this);
    1.23 +    if (text) {
    1.24 +	result = (SDL_strlen(text)>0) ? SDL_TRUE : SDL_FALSE;
    1.25 +	SDL_free(text);
    1.26      }
    1.27 -
    1.28 -    [pool release];
    1.29 -
    1.30      return result;
    1.31  }
    1.32