mshtml: Reimplement nsIURI::SetHost on top of IUriBuilder.

This commit is contained in:
Jacek Caban 2011-04-08 13:04:14 +02:00 committed by Alexandre Julliard
parent 094db744ce
commit 593d3f4492

View File

@ -1921,25 +1921,33 @@ static nsresult NSAPI nsURI_GetHost(nsIURL *iface, nsACString *aHost)
TRACE("(%p)->(%p)\n", This, aHost); TRACE("(%p)->(%p)\n", This, aHost);
if(This->nsuri)
return nsIURI_GetHost(This->nsuri, aHost);
return get_uri_string(This, Uri_PROPERTY_HOST, aHost); return get_uri_string(This, Uri_PROPERTY_HOST, aHost);
} }
static nsresult NSAPI nsURI_SetHost(nsIURL *iface, const nsACString *aHost) static nsresult NSAPI nsURI_SetHost(nsIURL *iface, const nsACString *aHost)
{ {
nsWineURI *This = impl_from_nsIURL(iface); nsWineURI *This = impl_from_nsIURL(iface);
const char *hosta;
WCHAR *host;
HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aHost)); TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aHost));
if(This->nsuri) { if(!ensure_uri_builder(This))
invalidate_uri(This); return NS_ERROR_UNEXPECTED;
return nsIURI_SetHost(This->nsuri, aHost);
}
FIXME("default action not implemented\n"); nsACString_GetData(aHost, &hosta);
return NS_ERROR_NOT_IMPLEMENTED; host = heap_strdupAtoW(hosta);
if(!host)
return NS_ERROR_OUT_OF_MEMORY;
hres = IUriBuilder_SetHost(This->uri_builder, host);
heap_free(host);
if(FAILED(hres))
return NS_ERROR_UNEXPECTED;
sync_wine_url(This);
return NS_OK;
} }
static nsresult NSAPI nsURI_GetPort(nsIURL *iface, PRInt32 *aPort) static nsresult NSAPI nsURI_GetPort(nsIURL *iface, PRInt32 *aPort)