backing out last patch for bug 240771 - causes crashes on mac.

This commit is contained in:
cbiesinger%web.de 2004-04-17 12:13:55 +00:00
Родитель 93f6d16654
Коммит 19e7aa65ac
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -224,16 +224,16 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
if (!hasDefault && miByType && miByExt) { if (!hasDefault && miByType && miByExt) {
// IC currently always uses nsMIMEInfoBase-derived classes. // IC currently always uses nsMIMEInfoBase-derived classes.
// When it stops doing that, this code will need changing. // When it stops doing that, this code will need changing.
// Using dynamic_cast here so we can fail sorta gracefully if this is no // XXX This assumes that IC will give os an nsMIMEInfoBase. I'd use
// nsMIMEInfoMac. // dynamic_cast but that crashes.
// XXX these pBy* variables are needed because .get() returns an // XXX these pBy* variables are needed because .get() returns an
// nsDerivedSafe thingy that can't be cast to nsMIMEInfoBase* // nsDerivedSafe thingy that can't be cast to nsMIMEInfoBase*
nsIMIMEInfo* pByType = miByType.get(); nsIMIMEInfo* pByType = miByType.get();
nsIMIMEInfo* pByExt = miByExt.get(); nsIMIMEInfo* pByExt = miByExt.get();
nsMIMEInfoMac* byType = dynamic_cast<nsMIMEInfoMac*>(pByType); nsMIMEInfoBase* byType = NS_STATIC_CAST(nsMIMEInfoBase*, pByType);
nsMIMEInfoMac* byExt = dynamic_cast<nsMIMEInfoMac*>(pByExt); nsMIMEInfoBase* byExt = NS_STATIC_CAST(nsMIMEInfoBase*, pByExt);
if (!byType || !byExt) { if (!byType || !byExt) {
NS_ERROR("IC gave us an nsIMIMEInfo that's no nsMIMEInfoMac! Fix nsOSHelperAppService."); NS_ERROR("IC gave us an nsIMIMEInfo that's no nsMIMEInfoBase! Fix nsOSHelperAppService.");
return nsnull; return nsnull;
} }
// Copy the attributes of miByType onto miByExt // Copy the attributes of miByType onto miByExt