зеркало из https://github.com/mozilla/gecko-dev.git
fix bug where we were leaving off the null on our mapping flavor.
This commit is contained in:
Родитель
94e59deb6b
Коммит
e64b36806a
|
@ -173,9 +173,9 @@ nsClipboard :: SetNativeClipboardData ( PRInt32 aWhichClipboard )
|
|||
#if TARGET_CARBON
|
||||
ScrapRef scrap;
|
||||
::GetCurrentScrap(&scrap);
|
||||
::PutScrapFlavor(scrap, nsMimeMapperMac::MappingFlavor(), 0L/*???*/, mappingLen - 1, mapping);
|
||||
::PutScrapFlavor(scrap, nsMimeMapperMac::MappingFlavor(), 0L/*???*/, mappingLen, mapping);
|
||||
#else
|
||||
long numBytes = ::PutScrap ( mappingLen - 1, nsMimeMapperMac::MappingFlavor(), mapping );
|
||||
long numBytes = ::PutScrap ( mappingLen, nsMimeMapperMac::MappingFlavor(), mapping );
|
||||
if ( numBytes != noErr )
|
||||
errCode = NS_ERROR_FAILURE;
|
||||
#endif
|
||||
|
|
|
@ -377,12 +377,12 @@ nsDragService :: RegisterDragItemsAndFlavors ( nsISupportsArray * inArray )
|
|||
// put the mime mapping data for this item in a special flavor. Unlike the other data,
|
||||
// we have to put the data in now (rather than defer it) or the mappings will go out
|
||||
// of scope by the time they are asked for. Remember that the |mappingLen|
|
||||
// includes the null.
|
||||
// includes the null, and we need to maintain that for when we parse it.
|
||||
short mappingLen;
|
||||
char* mapping = theMapper.ExportMapping(&mappingLen);
|
||||
if ( mapping && mappingLen ) {
|
||||
::AddDragItemFlavor ( mDragRef, itemIndex, nsMimeMapperMac::MappingFlavor(),
|
||||
mapping, mappingLen - 1, flags );
|
||||
mapping, mappingLen, flags );
|
||||
nsCRT::free ( mapping );
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче