Module: wine Branch: master Commit: 593d3f4492f4057ddc4e9cdd3e9b47a995e9f12f URL: http://source.winehq.org/git/wine.git/?a=commit;h=593d3f4492f4057ddc4e9cdd3e...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Apr 8 13:04:14 2011 +0200
mshtml: Reimplement nsIURI::SetHost on top of IUriBuilder.
---
dlls/mshtml/nsio.c | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index b25aae0..bd6a411 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1921,25 +1921,33 @@ static nsresult NSAPI nsURI_GetHost(nsIURL *iface, nsACString *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); }
static nsresult NSAPI nsURI_SetHost(nsIURL *iface, const nsACString *aHost) { nsWineURI *This = impl_from_nsIURL(iface); + const char *hosta; + WCHAR *host; + HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aHost));
- if(This->nsuri) { - invalidate_uri(This); - return nsIURI_SetHost(This->nsuri, aHost); - } + if(!ensure_uri_builder(This)) + return NS_ERROR_UNEXPECTED;
- FIXME("default action not implemented\n"); - return NS_ERROR_NOT_IMPLEMENTED; + nsACString_GetData(aHost, &hosta); + 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)