Jacek Caban : mshtml: Added nsIURI::SetSpec implementation.

Alexandre Julliard julliard at winehq.org
Fri Feb 4 09:37:16 CST 2011


Module: wine
Branch: master
Commit: a1205c6adce3a4c5f17af32da7e4366e73cd13f9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a1205c6adce3a4c5f17af32da7e4366e73cd13f9

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb  3 20:47:58 2011 +0100

mshtml: Added nsIURI::SetSpec implementation.

---

 dlls/mshtml/nsio.c |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index dec00aa..d08908f 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)




More information about the wine-cvs mailing list