[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23635] trunk/blender/intern/ghost/intern/ GHOST_SystemCocoa.mm: Cocoa port : Fix bugs in clipboard operations
Damien Plisson
damien.plisson at yahoo.fr
Mon Oct 5 17:00:07 CEST 2009
Revision: 23635
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23635
Author: damien78
Date: 2009-10-05 17:00:07 +0200 (Mon, 05 Oct 2009)
Log Message:
-----------
Cocoa port : Fix bugs in clipboard operations
Modified Paths:
--------------
trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm 2009-10-05 13:25:56 UTC (rev 23634)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm 2009-10-05 15:00:07 UTC (rev 23635)
@@ -1271,7 +1271,7 @@
NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard];
- if (pasteBoard = nil) {
+ if (pasteBoard == nil) {
[pool drain];
return NULL;
}
@@ -1289,11 +1289,19 @@
NSString * textPasted = [pasteBoard stringForType:@"public.utf8-plain-text"];
+ if (textPasted == nil) {
+ [pool drain];
+ return NULL;
+ }
+
pastedTextSize = [textPasted lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
- if (temp_buff == NULL) return NULL;
+ if (temp_buff == NULL) {
+ [pool drain];
+ return NULL;
+ }
strncpy((char*)temp_buff, [textPasted UTF8String], pastedTextSize);
@@ -1318,12 +1326,12 @@
NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard];
- if (pasteBoard = nil) {
+ if (pasteBoard == nil) {
[pool drain];
return;
}
- NSArray *supportedTypes = [NSArray arrayWithObjects: @"public.utf8-plain-text",nil];
+ NSArray *supportedTypes = [NSArray arrayWithObject:@"public.utf8-plain-text"];
[pasteBoard declareTypes:supportedTypes owner:nil];
More information about the Bf-blender-cvs
mailing list