зеркало из https://github.com/mozilla/gecko-dev.git
Fix for 8405. Japanese shows up in thread pane sender column. r=nhotta, waterson.
This commit is contained in:
Родитель
8f99495254
Коммит
e3af0aa031
|
@ -41,6 +41,7 @@
|
|||
#include "nsIMessageView.h"
|
||||
#include "nsMsgUtils.h"
|
||||
#include "nsMessageViewDataSource.h"
|
||||
#include "nsTextFormatter.h"
|
||||
|
||||
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
|
@ -301,13 +302,28 @@ nsresult nsMsgMessageDataSource::GetSenderName(nsAutoString& sender, nsAutoStrin
|
|||
nsresult rv = NS_OK;
|
||||
if(mHeaderParser)
|
||||
{
|
||||
|
||||
char *name;
|
||||
if(NS_SUCCEEDED(rv = mHeaderParser->ExtractHeaderAddressName (nsnull, nsAutoCString(sender), &name)))
|
||||
{
|
||||
*senderUserName = name;
|
||||
char *senderUTF8 = sender.ToNewUTF8String();
|
||||
if(!senderUTF8)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if(NS_SUCCEEDED(rv = mHeaderParser->ExtractHeaderAddressName("UTF-8", senderUTF8, &name)))
|
||||
{
|
||||
if(name)
|
||||
{
|
||||
PRUnichar *newSender;
|
||||
nsAutoString fmt("%s");
|
||||
newSender = nsTextFormatter::smprintf(fmt.GetUnicode(),name);
|
||||
if(newSender)
|
||||
{
|
||||
senderUserName->SetString(newSender);
|
||||
nsTextFormatter::smprintf_free(newSender);
|
||||
}
|
||||
nsCRT::free(name);
|
||||
}
|
||||
Recycle(senderUTF8);
|
||||
}
|
||||
if(name)
|
||||
PL_strfree(name);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ TestSegmentedBuffer();
|
|||
void XXXNeverCalled()
|
||||
{
|
||||
nsTextFormatter::snprintf(nsnull,0,nsnull);
|
||||
nsTextFormatter::smprintf(nsnull, nsnull);
|
||||
nsTextFormatter::smprintf_free(nsnull);
|
||||
dummyComparitor dummy;
|
||||
nsVoidArray();
|
||||
nsAVLTree(dummy, nsnull);
|
||||
|
|
Загрузка…
Ссылка в новой задаче