Hi

I know, it's annoying with 10.5, but I realised tonight that an older cocoa 
pasteboard commit broke flightgear osx cocoa 10.5 support and I kindly ask you 
to verify the patch below. With this code it is still possible to compile 
flightgear with target 10.5 and sdk 10.5. I will use this for the FGx launcher 
which still supports 10.5 (I hope), and as this is the only commit since some 
months that breaks 10.5 support ... could this code go to flightgear repo, 
unless flightgear osx 10.5 support is deprecated completely ?

Thanks, Yves

--- ClipboardCocoa.mm    2013-02-03 23:17:09.000000000 +0100
+++ ClipboardCocoa.mm.patched    2013-02-03 23:23:47.000000000 +0100
@@ -67,7 +67,11 @@
      if( type == CLIPBOARD )
      {
        NSPasteboard* pboard = [NSPasteboard generalPasteboard];
+        #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+        NSString* nstext = [pboard stringForType:NSStringPboardType];
+        #else // > 10.5
        NSString* nstext = [pboard stringForType:NSPasteboardTypeString];
+        #endif // MAC_OS_X_VERSION_MIN_REQUIRED
        return stdStringFromCocoa(nstext);
      }

@@ -85,8 +89,16 @@
      {
        NSPasteboard* pboard = [NSPasteboard generalPasteboard];
        NSString* nstext = stdStringToCocoa(text);
-        [pboard clearContents];
-        [pboard setString:nstext forType:NSPasteboardTypeString];
+        #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+            NSString* type = NSStringPboardType;
+            NSArray* types = [NSArray arrayWithObjects: type, nil];
+            [pboard declareTypes:types owner:nil];
+            [pboard setString:nstext forType: NSStringPboardType];
+        #else // > 10.5
+            NSString* type = NSPasteboardTypeString;
+            [pboard clearContents];
+            [pboard setString:nstext forType:NSPasteboardTypeString];
+        #endif // MAC_OS_X_VERSION_MIN_REQUIRED
        return true;
      }

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to