зеркало из https://github.com/mozilla/gecko-dev.git
Bug #18591 --> turn on the address book collector for email addresses in the message pane. I needed
a collector method that would take a unicode string. r=bienvenu
This commit is contained in:
Родитель
b805bebf76
Коммит
5b2f19acd0
|
@ -27,6 +27,12 @@
|
|||
|
||||
interface nsIAbAddressCollecter : nsISupports {
|
||||
|
||||
void CollectAddress(in string address);
|
||||
void collectAddress(in string address);
|
||||
/* CollectUnicodeAddress is the most I18N friendly
|
||||
of the two methods to call. If you just take a char * address
|
||||
as used by CollectAddress then you don't know what char set
|
||||
the address is in (UTF-8??).
|
||||
*/
|
||||
void collectUnicodeAddress(in wstring address);
|
||||
};
|
||||
|
||||
|
|
|
@ -60,6 +60,23 @@ nsAbAddressCollecter::~nsAbAddressCollecter()
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbAddressCollecter::CollectUnicodeAddress(const PRUnichar * aAddress)
|
||||
{
|
||||
NS_ENSURE_ARG(aAddress);
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// convert the unicode string to UTF-8...
|
||||
nsAutoString unicodeString (aAddress);
|
||||
char * utf8Version = unicodeString.ToNewUTF8String();
|
||||
if (utf8Version)
|
||||
{
|
||||
rv = CollectAddress(utf8Version);
|
||||
Recycle(utf8Version);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbAddressCollecter::CollectAddress(const char *address)
|
||||
{
|
||||
nsresult rv;
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
virtual ~nsAbAddressCollecter();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIABADDRESSCOLLECTER
|
||||
NS_DECL_NSIABADDRESSCOLLECTER
|
||||
|
||||
nsresult OpenHistoryAB(nsIAddrDatabase **aDatabase);
|
||||
nsresult IsDomainExcluded(const char *address, nsIPref *pPref, PRBool *bExclude);
|
||||
|
|
Загрузка…
Ссылка в новой задаче