зеркало из https://github.com/mozilla/gecko-dev.git
Bug #5938 --> if the user forces a charset, reload the current message forcing that charset.
This commit is contained in:
Родитель
19bb1e9f96
Коммит
12b2b0cb66
|
@ -1307,16 +1307,18 @@ 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())
|
||||
{
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
mDocShell->GetContentViewer(getter_AddRefs(cv));
|
||||
if (cv)
|
||||
nsIMsgMessageService * messageService = nsnull;
|
||||
nsresult rv = GetMessageServiceFromURI(mLastDisplayURI, &messageService);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && messageService)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче