mshtml: Added IUri-based implementation of nsIURL::[Get|Set]Ref.
This commit is contained in:
parent
2b80213578
commit
e72e7de0e5
|
@ -2217,34 +2217,53 @@ static nsresult NSAPI nsURL_SetQuery(nsIURL *iface, const nsACString *aQuery)
|
||||||
static nsresult NSAPI nsURL_GetRef(nsIURL *iface, nsACString *aRef)
|
static nsresult NSAPI nsURL_GetRef(nsIURL *iface, nsACString *aRef)
|
||||||
{
|
{
|
||||||
nsWineURI *This = impl_from_nsIURL(iface);
|
nsWineURI *This = impl_from_nsIURL(iface);
|
||||||
|
char *refa = NULL;
|
||||||
|
BSTR ref;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, aRef);
|
TRACE("(%p)->(%p)\n", This, aRef);
|
||||||
|
|
||||||
if(This->nsurl)
|
if(!ensure_uri(This))
|
||||||
return nsIURL_GetRef(This->nsurl, aRef);
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
|
||||||
FIXME("default action not implemented\n");
|
hres = IUri_GetFragment(This->uri, &ref);
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
if(FAILED(hres))
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
|
||||||
|
refa = heap_strdupWtoA(ref);
|
||||||
|
SysFreeString(ref);
|
||||||
|
if(ref && !refa)
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
nsACString_SetData(aRef, refa && *refa == '#' ? refa+1 : refa);
|
||||||
|
heap_free(refa);
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult NSAPI nsURL_SetRef(nsIURL *iface, const nsACString *aRef)
|
static nsresult NSAPI nsURL_SetRef(nsIURL *iface, const nsACString *aRef)
|
||||||
{
|
{
|
||||||
nsWineURI *This = impl_from_nsIURL(iface);
|
nsWineURI *This = impl_from_nsIURL(iface);
|
||||||
const char *refa;
|
const char *refa;
|
||||||
|
WCHAR *ref;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aRef));
|
TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aRef));
|
||||||
|
|
||||||
if(This->nsurl) {
|
if(!ensure_uri_builder(This))
|
||||||
invalidate_uri(This);
|
return NS_ERROR_UNEXPECTED;
|
||||||
return nsIURL_SetRef(This->nsurl, aRef);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsACString_GetData(aRef, &refa);
|
nsACString_GetData(aRef, &refa);
|
||||||
if(!*refa)
|
ref = heap_strdupAtoW(refa);
|
||||||
return NS_OK;
|
if(!ref)
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
FIXME("default action not implemented\n");
|
hres = IUriBuilder_SetFragment(This->uri_builder, ref);
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
heap_free(ref);
|
||||||
|
if(FAILED(hres))
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
|
||||||
|
sync_wine_url(This);
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult NSAPI nsURL_GetDirectory(nsIURL *iface, nsACString *aDirectory)
|
static nsresult NSAPI nsURL_GetDirectory(nsIURL *iface, nsACString *aDirectory)
|
||||||
|
|
Loading…
Reference in New Issue