diff options
author | Jean Guyomarc'h <jean.guyomarch@openwide.fr> | 2015-10-15 10:38:53 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-12-01 12:15:32 -0800 |
commit | 2f883ba1514438f31be2ed8b2f8f1591ae0b3c78 (patch) | |
tree | 15e0a22074e5e6b5069b25a5a047225041db1b0b /src/lib/ecore_cocoa | |
parent | 32d6cb6efdceef8b6ac0988d4babfe704bac061d (diff) |
ecore_cocoa_cnp: clear the clipboard only if writable
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r-- | src/lib/ecore_cocoa/ecore_cocoa_cnp.m | 8 |
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, | |||
15 | Ecore_Cocoa_Cnp_Type type) | 15 | Ecore_Cocoa_Cnp_Type type) |
16 | { | 16 | { |
17 | static NSMutableArray *objects = nil; | 17 | static NSMutableArray *objects = nil; |
18 | NSPasteboard *pb; | ||
19 | NSString *str = nil; | 18 | NSString *str = nil; |
20 | BOOL ok = YES; | 19 | BOOL ok = YES; |
21 | 20 | ||
22 | if (!objects) | 21 | if (!objects) |
23 | objects = [[NSMutableArray alloc] init]; | 22 | objects = [[NSMutableArray alloc] init]; |
24 | 23 | ||
25 | pb = [NSPasteboard generalPasteboard]; | ||
26 | [pb clearContents]; | ||
27 | |||
28 | if (type & ECORE_COCOA_CNP_TYPE_STRING) | 24 | if (type & ECORE_COCOA_CNP_TYPE_STRING) |
29 | { | 25 | { |
30 | str = [[NSString alloc] initWithBytes: data | 26 | str = [[NSString alloc] initWithBytes: data |
@@ -55,6 +51,10 @@ ecore_cocoa_selection_clipboard_set(const void *data, | |||
55 | /* Write to pasteboard */ | 51 | /* Write to pasteboard */ |
56 | if ([objects count] > 0) | 52 | if ([objects count] > 0) |
57 | { | 53 | { |
54 | NSPasteboard *pb; | ||
55 | |||
56 | pb = [NSPasteboard generalPasteboard]; | ||
57 | [pb clearContents]; | ||
58 | ok = [pb writeObjects: objects]; | 58 | ok = [pb writeObjects: objects]; |
59 | [objects removeAllObjects]; | 59 | [objects removeAllObjects]; |
60 | } | 60 | } |