fix bug 67557 - bad use of NS_LITERAL_STRING to initialize static const PRUnichar* literals. r=jag sr=brendan

This commit is contained in:
jband%netscape.com 2001-02-04 06:47:44 +00:00
Родитель 02d1ad6807
Коммит ab1f2436af
2 изменённых файлов: 19 добавлений и 11 удалений

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

@ -2110,8 +2110,11 @@ nsXPCComponents::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, c
NS_IMETHODIMP
nsXPCComponents::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
static const PRUnichar* interfaces = NS_LITERAL_STRING("interfaces");
if(!nsCRT::strcmp(propertyName, interfaces))
static const NS_NAMED_LITERAL_STRING(s_interfaces, "interfaces");
const nsLiteralString name(propertyName);
if(name.Equals(s_interfaces))
*_retval = CloneAllAccess();
else
*_retval = nsnull;

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

@ -386,8 +386,11 @@ nsXPCException::CanCreateWrapper(const nsIID * iid, char **_retval)
NS_IMETHODIMP
nsXPCException::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
static const PRUnichar* toString = NS_LITERAL_STRING("toString");
if(!nsCRT::strcmp(methodName, toString))
static const NS_NAMED_LITERAL_STRING(s_toString, "toString");
const nsLiteralString name(methodName);
if(name.Equals(s_toString))
*_retval = CloneAllAccess();
else
*_retval = nsnull;
@ -398,13 +401,15 @@ nsXPCException::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, ch
NS_IMETHODIMP
nsXPCException::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
static const PRUnichar* message = NS_LITERAL_STRING("message");
static const PRUnichar* result = NS_LITERAL_STRING("result");
static const PRUnichar* name = NS_LITERAL_STRING("name");
if(!nsCRT::strcmp(propertyName, message) ||
!nsCRT::strcmp(propertyName, result) ||
!nsCRT::strcmp(propertyName, name))
static const NS_NAMED_LITERAL_STRING(s_message, "message");
static const NS_NAMED_LITERAL_STRING(s_result , "result");
static const NS_NAMED_LITERAL_STRING(s_name , "name");
const nsLiteralString name(propertyName);
if(name.Equals(s_message) ||
name.Equals(s_result) ||
name.Equals(s_name))
*_retval = CloneAllAccess();
else
*_retval = nsnull;