Bug 452805, rearrange so that flavours are ordered in same order as getSupportedFlavours returns, r=neil

This commit is contained in:
Neil Deakin 2008-09-10 12:57:58 -04:00
parent 4647bc5c99
commit f3e1336106

View File

@ -471,14 +471,13 @@ var nsDragAndDrop = {
var count = dt.mozItemCount;
for (var i = 0; i < count; ++i) {
var types = dt.mozTypesAt(i);
for (var j = 0; j < types.length; ++j) {
var type = types[j];
for (var j = 0; j < flavourSet.flavours.length; j++) {
var type = flavourSet.flavours[j].contentType;
// dataTransfer uses text/plain but older code used text/unicode, so
// switch this for compatibility
if (type == "text/plain")
type = "text/unicode";
if (type in flavourSet.flavourTable) {
var data = dt.mozGetDataAt(type, i);
var modtype = (type == "text/unicode") ? "text/plain" : type;
if (Array.indexOf(types, modtype) >= 0) {
var data = dt.mozGetDataAt(modtype, i);
if (data) {
var length = (typeof data == "string") ? data.length : kNonStringDataLength;
dataArray[i] = FlavourToXfer(data, length, flavourSet.flavourTable[type]);