зеркало из https://github.com/mozilla/pjs.git
#376777 Only set text/uri-list from x-moz-url when no uri-list has beenexplicitly set. Patch by Tomeu Vizoso.r=roc sr=roc
This commit is contained in:
Родитель
41b2c96659
Коммит
3e503a6da6
|
@ -1133,18 +1133,6 @@ nsDragService::SourceDataGet(GtkWidget *aWidget,
|
|||
return;
|
||||
}
|
||||
|
||||
if (strcmp(mimeFlavor, gTextUriListType) == 0) {
|
||||
// fall back for text/uri-list
|
||||
gchar *uriList;
|
||||
gint length;
|
||||
CreateUriList(mSourceDataItems, &uriList, &length);
|
||||
gtk_selection_data_set(aSelectionData,
|
||||
aSelectionData->target,
|
||||
8, (guchar *)uriList, length);
|
||||
g_free(uriList);
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> genericItem;
|
||||
mSourceDataItems->GetElementAt(0, getter_AddRefs(genericItem));
|
||||
nsCOMPtr<nsITransferable> item;
|
||||
|
@ -1164,6 +1152,12 @@ nsDragService::SourceDataGet(GtkWidget *aWidget,
|
|||
actualFlavor = kURLMime;
|
||||
needToDoConversionToPlainText = PR_TRUE;
|
||||
}
|
||||
// if someone was asking for text/uri-list we need to convert to
|
||||
// plain text.
|
||||
else if (strcmp(mimeFlavor, gTextUriListType) == 0) {
|
||||
actualFlavor = gTextUriListType;
|
||||
needToDoConversionToPlainText = PR_TRUE;
|
||||
}
|
||||
else
|
||||
actualFlavor = mimeFlavor;
|
||||
|
||||
|
@ -1205,6 +1199,18 @@ nsDragService::SourceDataGet(GtkWidget *aWidget,
|
|||
// this wasn't allocated with glib
|
||||
free(tmpData);
|
||||
}
|
||||
} else {
|
||||
if (strcmp(mimeFlavor, gTextUriListType) == 0) {
|
||||
// fall back for text/uri-list
|
||||
gchar *uriList;
|
||||
gint length;
|
||||
CreateUriList(mSourceDataItems, &uriList, &length);
|
||||
gtk_selection_data_set(aSelectionData,
|
||||
aSelectionData->target,
|
||||
8, (guchar *)uriList, length);
|
||||
g_free(uriList);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче