else if (flavor.Equals(NS_LITERAL_STRING(kJPEGImageMime)))
else if (flavor.EqualsWithConversion(kJPEGImageMime))
NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable,                                                    const nsAReadableString & aContextStr,                                                   const nsAReadableString & aInfoStr){  nsresult rv = NS_OK;  char* bestFlavor = nsnull;  nsCOMPtr<nsISupports> genericDataObj;  PRUint32 len = 0;  if ( NS_SUCCEEDED(transferable->GetAnyTransferData(&bestFlavor, getter_AddRefs(genericDataObj), &len)) )  {    nsAutoTxnsConserveSelection dontSpazMySelection(this);    nsAutoString flavor, stuffToPaste;    flavor.AssignWithConversion( bestFlavor );   // just so we can use flavor.Equals()#ifdef DEBUG_clipboard    printf("Got flavor [%s]\n", bestFlavor);#endif    if (flavor.Equals(NS_LITERAL_STRING(kHTMLMime)))    {      nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) );      if (textDataObj && len > 0)      {        PRUnichar* text = nsnull;        textDataObj->ToString ( &text );        nsAutoString debugDump (text);        stuffToPaste.Assign ( text, len / 2 );        nsAutoEditBatch beginBatching(this);        rv = InsertHTMLWithContext(stuffToPaste, aContextStr, aInfoStr);        if (text)          nsMemory::Free(text);      }    }    else if (flavor.Equals(NS_LITERAL_STRING(kUnicodeMime)))    {      nsCOMPtr<nsISupportsWString> textDataObj ( do_QueryInterface(genericDataObj) );      if (textDataObj && len > 0)      {        PRUnichar* text = nsnull;        textDataObj->ToString ( &text );        stuffToPaste.Assign ( text, len / 2 );        nsAutoEditBatch beginBatching(this);        // pasting does not inherit local inline styles        RemoveAllInlineProperties();        rv = InsertText(stuffToPaste);        if (text)          nsMemory::Free(text);      }    }    else if (flavor.Equals(NS_LITERAL_STRING(kFileMime)))    {      nsCOMPtr<nsIFile> fileObj ( do_QueryInterface(genericDataObj) );      if (fileObj && len > 0)      {                nsCOMPtr<nsIURI> uri;        rv = NS_NewFileURI(getter_AddRefs(uri), fileObj);        if (NS_FAILED(rv))          return rv;                nsCOMPtr<nsIURL> fileURL(do_QueryInterface(uri));        if ( fileURL )        {          PRBool insertAsImage = PR_FALSE;          char *fileextension = nsnull;          rv = fileURL->GetFileExtension( &fileextension );          if ( NS_SUCCEEDED(rv) && fileextension )          {            if ( (nsCRT::strcasecmp( fileextension, "jpg" ) == 0 )              || (nsCRT::strcasecmp( fileextension, "jpeg" ) == 0 )              || (nsCRT::strcasecmp( fileextension, "gif" ) == 0 )              || (nsCRT::strcasecmp( fileextension, "png" ) == 0 ) )            {              insertAsImage = PR_TRUE;            }          }          if (fileextension) nsCRT::free(fileextension);                    char *urltext = nsnull;          rv = fileURL->GetSpec( &urltext );          if ( NS_SUCCEEDED(rv) && urltext && urltext[0] != 0)          {            len = strlen(urltext);            if ( insertAsImage )            {              stuffToPaste.Assign(NS_LITERAL_STRING("<IMG src=\""));              stuffToPaste.AppendWithConversion ( urltext, len );              stuffToPaste.Append(NS_LITERAL_STRING("\" alt=\"\" >"));            }            else /* insert as link */            {              stuffToPaste.Assign(NS_LITERAL_STRING("<A href=\""));              stuffToPaste.AppendWithConversion ( urltext, len );              stuffToPaste.Append(NS_LITERAL_STRING("\">"));              stuffToPaste.AppendWithConversion ( urltext, len );              stuffToPaste.Append(NS_LITERAL_STRING("</A>"));            }            nsAutoEditBatch beginBatching(this);            rv = InsertHTML(stuffToPaste);          }          if (urltext) nsCRT::free(urltext);        }      }    }    else if (flavor.Equals(NS_LITERAL_STRING(kJPEGImageMime)))    {      // Insert Image code here      printf("Don't know how to insert an image yet!\n");      //nsIImage* image = (nsIImage *)data;      //NS_RELEASE(image);      rv = NS_ERROR_NOT_IMPLEMENTED; // for now give error code    }  }  nsCRT::free(bestFlavor);        // Try to scroll the selection into view if the paste/drop succeeded  if (NS_SUCCEEDED(rv))  {    nsCOMPtr<nsISelectionController> selCon;    if (NS_SUCCEEDED(GetSelectionController(getter_AddRefs(selCon))) && selCon)      selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION);  }  return rv;}