зеркало из https://github.com/mozilla/gecko-dev.git
actually use the mime mapping flavor when determining if a flavor is in a drag item, rather than relying on the defaults. r=saari,sr=sfraser. bug# 68828.
This commit is contained in:
Родитель
794f5e3b1b
Коммит
ab87b3ed6d
|
@ -541,12 +541,6 @@ nsDragService :: IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval)
|
|||
|
||||
*_retval = PR_FALSE;
|
||||
|
||||
// convert to 4 character MacOS type
|
||||
//¥¥¥ this is wrong because it doesn't take the mime mappings present in the
|
||||
//¥¥¥ drag item flavor into account. FIX ME!
|
||||
nsMimeMapperMac theMapper;
|
||||
FlavorType macFlavor = theMapper.MapMimeTypeToMacOSType(aDataFlavor);
|
||||
|
||||
// search through all drag items looking for something with this flavor. Recall
|
||||
// that drag item indices are 1-based.
|
||||
unsigned short numDragItems = 0;
|
||||
|
@ -557,6 +551,12 @@ nsDragService :: IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval)
|
|||
if ( res != noErr )
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// convert to 4 character MacOS type for this item
|
||||
char* mappings = LookupMimeMappingsForItem(mDragRef, currItem) ;
|
||||
nsMimeMapperMac theMapper ( mappings );
|
||||
FlavorType macFlavor = theMapper.MapMimeTypeToMacOSType(aDataFlavor, PR_FALSE);
|
||||
nsMemory::Free(mappings);
|
||||
|
||||
FlavorFlags ignored;
|
||||
if ( ::GetFlavorFlags(mDragRef, currItem, macFlavor, &ignored) == noErr )
|
||||
*_retval = PR_TRUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче