Jacek Caban : mshtml: Reimplement nsIURI::SetScheme on top of IUri.

Alexandre Julliard julliard at winehq.org
Mon Mar 14 14:29:45 CDT 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Mar 14 14:06:37 2011 +0100

mshtml: Reimplement nsIURI::SetScheme on top of IUri.

---

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

diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index 327b191..016356d 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -1725,16 +1725,27 @@ static nsresult NSAPI nsURI_GetScheme(nsIURL *iface, nsACString *aScheme)
 static nsresult NSAPI nsURI_SetScheme(nsIURL *iface, const nsACString *aScheme)
 {
     nsWineURI *This = impl_from_nsIURL(iface);
+    const char *schemea;
+    WCHAR *scheme;
+    HRESULT hres;
 
     TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aScheme));
 
-    if(This->nsuri) {
-        invalidate_uri(This);
-        return nsIURI_SetScheme(This->nsuri, aScheme);
-    }
+    if(!ensure_uri_builder(This))
+        return NS_ERROR_UNEXPECTED;
 
-    FIXME("default action not implemented\n");
-    return NS_ERROR_NOT_IMPLEMENTED;
+    nsACString_GetData(aScheme, &schemea);
+    scheme = heap_strdupAtoW(schemea);
+    if(!scheme)
+        return NS_ERROR_OUT_OF_MEMORY;
+
+    hres = IUriBuilder_SetSchemeName(This->uri_builder, scheme);
+    heap_free(scheme);
+    if(FAILED(hres))
+        return NS_ERROR_UNEXPECTED;
+
+    sync_wine_url(This);
+    return NS_OK;
 }
 
 static nsresult NSAPI nsURI_GetUserPass(nsIURL *iface, nsACString *aUserPass)




More information about the wine-cvs mailing list