fix dragging URLs to the desktop. don't always claim to have promised file data. b=388522 r=shebs sr=pav

This commit is contained in:
joshmoz@gmail.com 2007-07-19 11:09:43 -07:00
Родитель fba73878f4
Коммит daca521237
2 изменённых файлов: 7 добавлений и 8 удалений

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

@ -378,6 +378,9 @@ nsClipboard::PasteboardDictFromTransferable(nsITransferable* aTransferable)
[pasteboardOutputDict setObject:tiffData forKey:NSTIFFPboardType];
}
else if (flavorStr.EqualsLiteral(kFilePromiseMime)) {
[pasteboardOutputDict setObject:[NSArray arrayWithObject:@""] forKey:NSFilesPromisePboardType];
}
// If it wasn't a type that we recognize as exportable we don't put it on the system
// clipboard. We'll just access it from our cached transferable when we need it.

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

@ -134,6 +134,9 @@ static nsresult SetUpDragClipboard(nsISupportsArray* aTransferableArray)
else if (currentKey == NSTIFFPboardType) {
[dragPBoard setData:currentValue forType:currentKey];
}
else if (currentKey == NSFilesPromisePboardType) {
[dragPBoard setPropertyList:currentValue forType:currentKey];
}
}
}
@ -271,18 +274,11 @@ nsDragService::InvokeDragSession(nsIDOMNode* aDOMNode, nsISupportsArray* aTransf
nsBaseDragService::StartDragSession();
// It is possible to specify what file types we will create, but the Finder doesn't
// care; it is happy to store any type of file it is handed. So use an empty string
// for type.
NSPasteboard* workingPBoard = [NSPasteboard pasteboardWithName:NSDragPboard];
NSArray* fileTypeList = [NSArray arrayWithObject:@""];
[workingPBoard setPropertyList:fileTypeList forType:NSFilesPromisePboardType];
[globalDragView dragImage:image
at:localPoint
offset:NSMakeSize(0,0)
event:globalDragEvent
pasteboard:workingPBoard
pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard]
source:globalDragView
slideBack:YES];