Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-05-04 18:14:54 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-05-04 18:14:54 +0400
commit4983308a38c6c157434ff991c09df78ea5b85e8b (patch)
tree467a2d8a3cffb3bb8045107a58a310d473d2742e /intern
parent27afa69c9a7b984f432fb76209b43a44f25708da (diff)
parente6be4547878a11839a6eb6a200d565b217483975 (diff)
svn merge -r 14649:14676 https://svn.blender.org/svnroot/bf-blender/trunk/blender (sorry - forgot half of the commits last time)
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index 568f7ecf9b8..78c25997806 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -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,12 +1121,15 @@ GHOST_TUns8* GHOST_SystemCarbon::getClipboard(int flag) const
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,18 @@ GHOST_TUns8* GHOST_SystemCarbon::getClipboard(int flag) const
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
+
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;}