aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>2015-10-15 10:38:53 +0200
committerChris Michael <cp.michael@samsung.com>2015-12-03 11:31:05 -0500
commitba73c40fdb2aef214b1c1631dcb2301f73555cbb (patch)
treedabf197d1261a086a4a0a1fdb0f464a92f8dc907
parentecore_cocoa: NSEvent modifiers are of type NSUInteger (diff)
downloadefl-ba73c40fdb2aef214b1c1631dcb2301f73555cbb.tar.gz
ecore_cocoa_cnp: clear the clipboard only if writable
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_cnp.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
index f94dfe98cd..605bfa9299 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
@@ -15,16 +15,12 @@ ecore_cocoa_selection_clipboard_set(const void *data,
Ecore_Cocoa_Cnp_Type type)
{
static NSMutableArray *objects = nil;
- NSPasteboard *pb;
NSString *str = nil;
BOOL ok = YES;
if (!objects)
objects = [[NSMutableArray alloc] init];
- pb = [NSPasteboard generalPasteboard];
- [pb clearContents];
-
if (type & ECORE_COCOA_CNP_TYPE_STRING)
{
str = [[NSString alloc] initWithBytes: data
@@ -55,6 +51,10 @@ ecore_cocoa_selection_clipboard_set(const void *data,
/* Write to pasteboard */
if ([objects count] > 0)
{
+ NSPasteboard *pb;
+
+ pb = [NSPasteboard generalPasteboard];
+ [pb clearContents];
ok = [pb writeObjects: objects];
[objects removeAllObjects];
}