Bug #5938 --> if the user forces a charset, reload the current message forcing that charset.

This commit is contained in:
mscott%netscape.com 2000-05-16 00:21:44 +00:00
Родитель 19bb1e9f96
Коммит 12b2b0cb66
1 изменённых файлов: 14 добавлений и 12 удалений

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

@ -1307,20 +1307,22 @@ nsMessenger::GetTransactionManager(nsITransactionManager* *aTxnMgr)
NS_IMETHODIMP nsMessenger::SetDocumentCharset(const PRUnichar *characterSet)
{
// Set a default charset of the webshell.
if (mDocShell)
// We want to redisplay the currently selected message (if any) but forcing the
// redisplay to use characterSet
if (!mLastDisplayURI.IsEmpty())
{
nsIMsgMessageService * messageService = nsnull;
nsresult rv = GetMessageServiceFromURI(mLastDisplayURI, &messageService);
if (NS_SUCCEEDED(rv) && messageService)
{
nsCOMPtr<nsIContentViewer> cv;
mDocShell->GetContentViewer(getter_AddRefs(cv));
if (cv)
{
nsCOMPtr<nsIMarkupDocumentViewer> muDV = do_QueryInterface(cv);
if (muDV)
muDV->SetDefaultCharacterSet(characterSet);
}
}
nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mDocShell));
messageService->DisplayMessage(mLastDisplayURI, webShell, mMsgWindow, nsnull, characterSet, nsnull);
ReleaseMessageServiceFromURI(mLastDisplayURI, messageService);
}
}
return NS_OK;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////////