else {  nsCOMPtr<nsIMIMEService> mimeService (do_GetService(NS_MIMESERVICE_CONTRACTID)); if (mimeService) { nsCOMPtr<nsIMIMEInfo> mimeinfo; if (NS_SUCCEEDED(mimeService->GetFromMIMEType(m_contentType.get(), getter_AddRefs(mimeinfo)))) { PRUint32 aMacType; PRUint32 aMacCreator; if (NS_SUCCEEDED(mimeinfo->GetMacType(&aMacType)) && NS_SUCCEEDED(mimeinfo->GetMacCreator(&aMacCreator))) realSpec.SetFileTypeAndCreator((OSType)aMacType, (OSType)aMacCreator); } }  } }
nsSaveMsgListener::OnStartRequest(nsIRequest* request, nsISupports* aSupport){    nsresult rv = NS_OK;    if (m_fileSpec)        rv = m_fileSpec->GetOutputStream(getter_AddRefs(m_outputStream));    if (NS_FAILED(rv) && m_messenger)    {        m_messenger->Alert("saveAttachmentFailed");    }    else if (!m_dataBuffer)    {        m_dataBuffer = (char*) PR_CALLOC(FOUR_K+1);    }    #ifdef XP_MAC  /* On Mac, if we are saving an appledouble or applesingle attachment, we need to use an Apple File Decoder */  if (!m_contentType.IsEmpty())    if ((nsCRT::strcasecmp(m_contentType.get(), APPLICATION_APPLEFILE) == 0) ||        (nsCRT::strcasecmp(m_contentType.get(), MULTIPART_APPLEDOUBLE) == 0))    {              /* ggrrrrr, I have a nsFileSpec but I need a nsILocalFile... */      nsCOMPtr<nsILocalFile> outputFile;      nsFileSpec realSpec;      m_fileSpec->GetFileSpec(&realSpec);      NS_FileSpecToIFile(&realSpec, getter_AddRefs(outputFile));            nsCOMPtr<nsIAppleFileDecoder> appleFileDecoder = do_CreateInstance(NS_IAPPLEFILEDECODER_CONTRACTID, &rv);      if (NS_SUCCEEDED(rv) && appleFileDecoder)      {        rv = appleFileDecoder->Initialize(m_outputStream, outputFile);        if (NS_SUCCEEDED(rv))          m_outputStream = do_QueryInterface(appleFileDecoder, &rv);      }    }#endif    return rv;}