added Unicode support and multiply the length now by 2 because and changed it to put Unicode on the clipboard for HTML

This commit is contained in:
rods%netscape.com 1999-08-18 14:56:39 +00:00
Родитель 82d9a43419
Коммит eb1c5bef67
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -128,9 +128,10 @@ NS_IMETHODIMP nsXIFFormatConverter::GetOutputDataFlavors(nsVoidArray ** aDataFla
nsVoidArray * array = new nsVoidArray(); nsVoidArray * array = new nsVoidArray();
if (nsnull != array) { if (nsnull != array) {
array->AppendElement(new nsString(kXIFMime)); array->AppendElement(new nsString(kXIFMime));
array->AppendElement(new nsString(kHTMLMime));
array->AppendElement(new nsString(kUnicodeMime));
array->AppendElement(new nsString(kTextMime)); array->AppendElement(new nsString(kTextMime));
array->AppendElement(new nsString(kAOLMailMime)); array->AppendElement(new nsString(kAOLMailMime));
array->AppendElement(new nsString(kHTMLMime));
*aDataFlavorList = array; *aDataFlavorList = array;
} }
return NS_OK; return NS_OK;
@ -154,6 +155,8 @@ NS_IMETHODIMP nsXIFFormatConverter::CanConvert(nsString * aFromDataFlavor, nsStr
return NS_OK; return NS_OK;
} else if (aToDataFlavor->Equals(kHTMLMime)) { } else if (aToDataFlavor->Equals(kHTMLMime)) {
return NS_OK; return NS_OK;
} else if (aToDataFlavor->Equals(kUnicodeMime)) {
return NS_OK;
} else if (aToDataFlavor->Equals(kAOLMailMime)) { } else if (aToDataFlavor->Equals(kAOLMailMime)) {
return NS_OK; return NS_OK;
} }
@ -187,10 +190,10 @@ NS_IMETHODIMP nsXIFFormatConverter::Convert(nsString * aFromDataFlavor, void * a
*aToData = (void *)text.ToNewCString(); *aToData = (void *)text.ToNewCString();
*aDataToLen = text.Length(); *aDataToLen = text.Length();
} }
} else if (aToDataFlavor->Equals(kHTMLMime)) { } else if (aToDataFlavor->Equals(kHTMLMime) || aToDataFlavor->Equals(kUnicodeMime)) {
if (NS_OK == ConvertFromXIFToHTML(srcText, text)) { if (NS_OK == ConvertFromXIFToHTML(srcText, text)) {
*aToData = (void *)text.ToNewCString(); *aToData = (void *)text.ToNewUnicode();
*aDataToLen = text.Length(); *aDataToLen = text.Length()*2;
} }
} else if (aToDataFlavor->Equals(kAOLMailMime)) { } else if (aToDataFlavor->Equals(kAOLMailMime)) {
if (NS_OK == ConvertFromXIFToAOLMail(srcText, text)) { if (NS_OK == ConvertFromXIFToAOLMail(srcText, text)) {