export urld type to the native clipboard on Mac OS X. patch by Stan Shebs. b=393609 r=josh sr=roc

This commit is contained in:
joshmoz@gmail.com 2007-09-27 18:50:09 -07:00
Родитель eb4152ca7e
Коммит 41d4917907
4 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1839,6 +1839,7 @@ NSEvent* gLastDragEvent = nil;
NSFilesPromisePboardType,
kWildcardPboardType,
kCorePboardType_url,
kCorePboardType_urld,
kCorePboardType_urln,
nil]];

Просмотреть файл

@ -492,6 +492,8 @@ nsClipboard::PasteboardDictFromTransferable(nsITransferable* aTransferable)
NSString *nativeTitle = [[NSString alloc] initWithCharacters:urlTitle.get() length:urlTitle.Length()];
// be nice to Carbon apps, normalize the receiver's contents using Form C.
[pasteboardOutputDict setObject:[nativeTitle precomposedStringWithCanonicalMapping] forKey:kCorePboardType_urln];
// Also put the title out as 'urld', since some recipients will look for that.
[pasteboardOutputDict setObject:[nativeTitle precomposedStringWithCanonicalMapping] forKey:kCorePboardType_urld];
[nativeTitle release];
}

Просмотреть файл

@ -45,6 +45,7 @@
extern NSString* const kWildcardPboardType;
extern NSString* const kCorePboardType_url;
extern NSString* const kCorePboardType_urld;
extern NSString* const kCorePboardType_urln;
class nsDragService : public nsBaseDragService

Просмотреть файл

@ -84,6 +84,7 @@ nsISupportsArray *gDraggedTransferables = nsnull;
NSString* const kWildcardPboardType = @"MozillaWildcard";
NSString* const kCorePboardType_url = @"CorePasteboardFlavorType 0x75726C20"; // 'url ' url
NSString* const kCorePboardType_urld = @"CorePasteboardFlavorType 0x75726C64"; // 'urld' desc
NSString* const kCorePboardType_urln = @"CorePasteboardFlavorType 0x75726C6E"; // 'urln' title
nsDragService::nsDragService()
@ -135,6 +136,7 @@ static nsresult SetUpDragClipboard(nsISupportsArray* aTransferableArray)
id currentValue = [pasteboardOutputDict valueForKey:currentKey];
if (currentKey == NSStringPboardType ||
currentKey == kCorePboardType_url ||
currentKey == kCorePboardType_urld ||
currentKey == kCorePboardType_urln) {
[dragPBoard setString:currentValue forType:currentKey];
}