mshtml: Added nsACString_SetData function and use it instead of nsACString_Init when we return string value.

This commit is contained in:
Jacek Caban 2006-12-14 00:20:26 +01:00 committed by Alexandre Julliard
parent 82a042d0df
commit f609a768e7
3 changed files with 10 additions and 4 deletions

View File

@ -332,6 +332,7 @@ void *nsalloc(size_t);
void nsfree(void*);
void nsACString_Init(nsACString*,const char*);
void nsACString_SetData(nsACString*,const char*);
PRUint32 nsACString_GetData(const nsACString*,const char**,PRBool*);
void nsACString_Finish(nsACString*);

View File

@ -422,7 +422,12 @@ void nsACString_Init(nsACString *str, const char *data)
{
NS_CStringContainerInit(str);
if(data)
NS_CStringSetData(str, data, PR_UINT32_MAX);
nsACString_SetData(str, data);
}
void nsACString_SetData(nsACString *str, const char *data)
{
NS_CStringSetData(str, data, PR_UINT32_MAX);
}
PRUint32 nsACString_GetData(const nsACString *str, const char **data, PRBool *termited)

View File

@ -475,7 +475,7 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString
TRACE("(%p)->(%p)\n", This, aContentType);
if(This->content) {
nsACString_Init(aContentType, This->content);
nsACString_SetData(aContentType, This->content);
return S_OK;
}
@ -483,7 +483,7 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString
return nsIChannel_GetContentType(This->channel, aContentType);
TRACE("returning default text/html\n");
nsACString_Init(aContentType, "text/html");
nsACString_SetData(aContentType, "text/html");
return NS_OK;
}
@ -1154,7 +1154,7 @@ static nsresult NSAPI nsURI_GetSpec(nsIWineURI *iface, nsACString *aSpec)
return nsIURI_GetSpec(This->uri, aSpec);
if(This->spec) {
nsACString_Init(aSpec, This->spec);
nsACString_SetData(aSpec, This->spec);
return NS_OK;
}