got rid of a 'pollution' in the previous checkin

This commit is contained in:
jshin%mailaps.org 2004-09-12 17:16:59 +00:00
Родитель 4b0e5313bd
Коммит 5919d52cd9
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -3117,16 +3117,17 @@ nsBookmarksService::UpdateBookmarkIcon(const char *aURL, const char *aMIMEType,
rv = gRDF->GetLiteral (NS_LITERAL_STRING("data:").get(), getter_AddRefs(iconDataLiteral)); rv = gRDF->GetLiteral (NS_LITERAL_STRING("data:").get(), getter_AddRefs(iconDataLiteral));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
} else { } else {
PRInt32 len = ((aIconDataLen + 2) / 3) * 4;
char *iconDataBase64 = PL_Base64Encode((const char *) aIconData, aIconDataLen, nsnull); char *iconDataBase64 = PL_Base64Encode((const char *) aIconData, aIconDataLen, nsnull);
if (!iconDataBase64) { if (!iconDataBase64) {
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
nsString dataUri; nsString dataUri;
dataUri.AssignLiteral("data:"); dataUri += NS_LITERAL_STRING("data:");
dataUri.AppendASCII(aMIMEType); dataUri += NS_ConvertASCIItoUTF16(aMIMEType);
dataUri.AppendLiteral(";base64,"); dataUri += NS_LITERAL_STRING(";base64,");
dataUri.AppendASCII(iconDataBase64); dataUri += NS_ConvertASCIItoUTF16(iconDataBase64, len);
nsMemory::Free(iconDataBase64); nsMemory::Free(iconDataBase64);
rv = gRDF->GetLiteral (dataUri.get(), getter_AddRefs(iconDataLiteral)); rv = gRDF->GetLiteral (dataUri.get(), getter_AddRefs(iconDataLiteral));