Changed to specify content type explicitly for GetMailNewFont().

This commit is contained in:
nhotta%netscape.com 2000-05-06 01:33:31 +00:00
Родитель a10e411fe3
Коммит a6089ad08d
2 изменённых файлов: 4 добавлений и 4 удалений

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

@ -1962,15 +1962,15 @@ int EndMailNewsFont(MimeObject *obj)
} }
// TODO: rewrite BeginMailNewFont to use this. // TODO: rewrite BeginMailNewFont to use this.
nsresult GetMailNewsFont(MimeObject *obj, char *fontName, PRInt32 *fontSize) nsresult GetMailNewsFont(MimeObject *obj, const char *contentType, char *fontName, PRInt32 *fontSize)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
// check Content-Type: // check Content-Type:
PRBool bTEXT_HTML = PR_FALSE; PRBool bTEXT_HTML = PR_FALSE;
if (!nsCRT::strcasecmp(obj->content_type, TEXT_HTML)) if (!nsCRT::strcasecmp(contentType, TEXT_HTML))
bTEXT_HTML = PR_TRUE; bTEXT_HTML = PR_TRUE;
else if (nsCRT::strcasecmp(obj->content_type, TEXT_PLAIN)) else if (nsCRT::strcasecmp(contentType, TEXT_PLAIN))
return NS_ERROR_FAILURE; // not supported type return NS_ERROR_FAILURE; // not supported type
nsIPref *aPrefs = GetPrefServiceManager(obj->options); nsIPref *aPrefs = GetPrefServiceManager(obj->options);

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

@ -164,7 +164,7 @@ extern "C" nsresult nsMimeNewURI(nsIURI** aInstancePtrResult, const char
extern "C" int BeginMailNewsFont(MimeObject *obj); extern "C" int BeginMailNewsFont(MimeObject *obj);
extern "C" int EndMailNewsFont(MimeObject *obj); extern "C" int EndMailNewsFont(MimeObject *obj);
extern "C" nsresult GetMailNewsFont(MimeObject *obj, char *fontName, PRInt32 *fontSize); extern "C" nsresult GetMailNewsFont(MimeObject *obj, const char *contentType, char *fontName, PRInt32 *fontSize);
#ifdef __cplusplus #ifdef __cplusplus
} }