From 99abd92c54bb54b55097d6bae4e822b5ff56976c Mon Sep 17 00:00:00 2001 From: dmitry Date: Sat, 16 Jun 2018 05:00:12 +0000 Subject: [PATCH] cocoa: using hard-coded paste(clip)board names, rather than their dynamic-symbol counterparts so the unit can be linked on MacOS < 10.6. #33762 git-svn-id: trunk@58287 - --- lcl/interfaces/cocoa/cocoawinapi.inc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoawinapi.inc b/lcl/interfaces/cocoa/cocoawinapi.inc index aed381a0df..75310d7bda 100644 --- a/lcl/interfaces/cocoa/cocoawinapi.inc +++ b/lcl/interfaces/cocoa/cocoawinapi.inc @@ -396,29 +396,26 @@ begin lDataType := ccdtNonStandard; // See PredefinedClipboardMimeTypes for the most common mime-types - {$IF not defined(MAC_OS_X_VERSION_MIN_REQUIRED) or (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)} case AMimeType of 'text/plain': begin - lNSStr := NSPasteboardTypeString; - lNSStr.retain; + //hack: the name of constants is a hack + // should be replaced with either weaklinking + // or dynamic loading (dlsym) + lNSStr := NSSTR('public.utf8-plain-text'); // NSPasteboardTypeString; // commented out for OSX < 10.6 see #33672 lDataType := ccdtText; end; 'image/png': begin - lNSStr := NSPasteboardTypePNG; - lNSStr.retain; + lNSStr := NSSTR('public.png'); // NSPasteboardTypePNG lDataType := ccdtCocoaStandard; end; 'image/bmp': begin - lNSStr := NSPasteboardTypePNG; + lNSStr := NSSTR('public.png'); // NSPasteboardTypePNG lDataType := ccdtBitmap; end; else - {$ELSE} - begin - {$ENDIF} lNSStr := NSStringUtf8(AMimeType); lDataType := ccdtNonStandard; end;