From a1205c6adce3a4c5f17af32da7e4366e73cd13f9 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 3 Feb 2011 20:47:58 +0100 Subject: [PATCH] mshtml: Added nsIURI::SetSpec implementation. --- dlls/mshtml/nsio.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index dec00aa9020..d08908f01f1 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1654,16 +1654,34 @@ static nsresult NSAPI nsURI_GetSpec(nsIURL *iface, nsACString *aSpec) static nsresult NSAPI nsURI_SetSpec(nsIURL *iface, const nsACString *aSpec) { nsWineURI *This = impl_from_nsIURL(iface); + const char *speca; + WCHAR *spec; + IUri *uri; + HRESULT hres; - TRACE("(%p)->(%p)\n", This, debugstr_nsacstr(aSpec)); + TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aSpec)); - if(This->nsuri) { - invalidate_uri(This); - return nsIURI_SetSpec(This->nsuri, aSpec); + nsACString_GetData(aSpec, &speca); + spec = heap_strdupAtoW(speca); + if(!spec) + return NS_ERROR_OUT_OF_MEMORY; + + hres = CreateUri(spec, 0, 0, &uri); + heap_free(spec); + if(FAILED(hres)) { + WARN("CreateUri failed: %08x\n", hres); + return NS_ERROR_FAILURE; } - FIXME("default action not implemented\n"); - return NS_ERROR_NOT_IMPLEMENTED; + invalidate_uri(This); + if(This->uri_builder) { + IUriBuilder_Release(This->uri_builder); + This->uri_builder = NULL; + } + + This->uri = uri; + sync_wine_url(This); + return NS_OK; } static nsresult NSAPI nsURI_GetPrePath(nsIURL *iface, nsACString *aPrePath)