[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14657] trunk/blender/intern/ghost/intern/ GHOST_SystemCarbon.cpp: fix for #10080 copy/paste operations were
JLuc Peuriere
jlp at nerim.net
Fri May 2 12:38:50 CEST 2008
Revision: 14657
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14657
Author: lukep
Date: 2008-05-02 12:38:50 +0200 (Fri, 02 May 2008)
Log Message:
-----------
fix for #10080 copy/paste operations were
broken after first on os X
Modified Paths:
--------------
trunk/blender/intern/ghost/intern/GHOST_SystemCarbon.cpp
Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCarbon.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCarbon.cpp 2008-05-02 10:33:32 UTC (rev 14656)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCarbon.cpp 2008-05-02 10:38:50 UTC (rev 14657)
@@ -34,10 +34,9 @@
* @date May 7, 2001
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <Carbon/Carbon.h>
+#include <ApplicationServices/ApplicationServices.h>
#include "GHOST_SystemCarbon.h"
#include "GHOST_DisplayManagerCarbon.h"
@@ -52,6 +51,7 @@
#include "GHOST_WindowManager.h"
#include "GHOST_WindowCarbon.h"
#include "GHOST_NDOFManager.h"
+#include "AssertMacros.h"
#define GHOST_KEY_SWITCH(mac, ghost) { case (mac): ghostKey = (ghost); break; }
@@ -1121,13 +1121,16 @@
OSStatus err = noErr;
GHOST_TUns8 * temp_buff;
CFRange range;
+ OSStatus syncFlags;
err = PasteboardCreate(kPasteboardClipboard, &inPasteboard);
if(err != noErr) { return NULL;}
- err = PasteboardSynchronize( inPasteboard );
- if(err != noErr) { return NULL;}
+ syncFlags = PasteboardSynchronize( inPasteboard );
+ /* as we always get in a new string, we can safely ignore sync flags if not an error*/
+ if(syncFlags <0) { return NULL;}
+
err = PasteboardGetItemIdentifier( inPasteboard, 1, &itemID );
if(err != noErr) { return NULL;}
@@ -1152,15 +1155,19 @@
void GHOST_SystemCarbon::putClipboard(GHOST_TInt8 *buffer, int flag) const
{
if(flag == 1) {return;} //If Flag is 1 means the selection and is used on X11
+ printf("flag %i string is %s \n",flag,buffer);
+
PasteboardRef inPasteboard;
CFDataRef textData = NULL;
OSStatus err = noErr; /*For error checking*/
+ OSStatus syncFlags;
err = PasteboardCreate(kPasteboardClipboard, &inPasteboard);
if(err != noErr) { return;}
- err = PasteboardSynchronize( inPasteboard );
- if(err != noErr) { return;}
+ syncFlags = PasteboardSynchronize( inPasteboard );
+ /* as we always put in a new string, we can safely ignore sync flags */
+ if(syncFlags <0) { return;}
err = PasteboardClear( inPasteboard );
if(err != noErr) { return;}
More information about the Bf-blender-cvs
mailing list