reviewed by Dave Harrison (first & second drafts) and Darin Adler (third...
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Jun 2005 00:42:53 +0000 (00:42 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Jun 2005 00:42:53 +0000 (00:42 +0000)
        - WebKit part of fix for
        <rdar://problem/4145214> REGRESSION (412+): Can't drag URLs from the location bar

        * Misc.subproj/WebNSPasteboardExtras.m:
        (+[NSPasteboard initialize]):
        Reinstate variation of old code that uses CreatePasteboardFlavorTypeName to set up our new pasteboard types.
        The newfangled way didn't work.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Misc.subproj/WebNSPasteboardExtras.m

index a05d9d4..ed2b077 100644 (file)
@@ -1,3 +1,15 @@
+2005-06-10  John Sullivan  <sullivan@apple.com>
+
+        reviewed by Dave Harrison (first & second drafts) and Darin Adler (third draft)
+
+        - WebKit part of fix for 
+        <rdar://problem/4145214> REGRESSION (412+): Can't drag URLs from the location bar
+
+        * Misc.subproj/WebNSPasteboardExtras.m:
+        (+[NSPasteboard initialize]):
+        Reinstate variation of old code that uses CreatePasteboardFlavorTypeName to set up our new pasteboard types.
+        The newfangled way didn't work.
+
 2005-06-07  Darin Adler  <darin@apple.com>
 
         Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
index d6838e3..c26c5c6 100644 (file)
@@ -50,13 +50,33 @@ NSString *WebURLNamePboardType = nil;
 
 + (void)initialize
 {
+    // FIXME  The code below addresses 3446192.  It was awaiting a fix for 3446669. Now that bug has been fixed,
+    // but this code still does not work; UTTypeCopyPreferredTagWithClass returns nil, which caused 4145214. Some
+    // day we'll need to investigate why this code is still not working.
+#ifdef UTI_PB_API
     CFStringRef osTypeString = UTCreateStringForOSType('url ');
     CFStringRef utiTypeString = UTTypeCreatePreferredIdentifierForTag( kUTTagClassOSType, osTypeString, NULL );
     WebURLPboardType = (NSString *)UTTypeCopyPreferredTagWithClass( kUTTagClassNSPboardType, utiTypeString );
+    if (osTypeString != NULL) {
+        CFRelease(osTypeString);
+    }
+    if (utiTypeString != NULL) {
+        CFRelease(utiTypeString);
+    }
     
     osTypeString = UTCreateStringForOSType('urln');
     utiTypeString = UTTypeCreatePreferredIdentifierForTag( kUTTagClassOSType, osTypeString, NULL );
     WebURLNamePboardType = (NSString *)UTTypeCopyPreferredTagWithClass( kUTTagClassNSPboardType, utiTypeString );
+    if (osTypeString != NULL) {
+        CFRelease(osTypeString);
+    }
+    if (utiTypeString != NULL) {
+        CFRelease(utiTypeString);
+    }
+#else
+    WebURLPboardType = WKCreateURLPasteboardFlavorTypeName();
+    WebURLNamePboardType = WKCreateURLNPasteboardFlavorTypeName();
+#endif
 }
 
 + (NSArray *)_web_writableTypesForURL