Module: wine Branch: master Commit: 5ea16d7856597349bf96e52fb95a7103dfaa6004 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5ea16d7856597349bf96e52fb9...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Feb 9 20:18:20 2007 +0100
mshtml: Added [Set|Get]WineURL functions to nsIWineURI.
---
dlls/mshtml/nsiface.idl | 2 ++ dlls/mshtml/nsio.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index fafa15d..a93c957 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -1533,4 +1533,6 @@ interface nsIWineURI : nsIURI nsresult SetMoniker(IMoniker *aMoniker); nsresult GetIsDocumentURI(PRBool *aIsDocumentURI); nsresult SetIsDocumentURI(PRBool aIsDocumentURI); + nsresult GetWineURL(LPCWSTR *aURL); + nsresult SetWineURL(LPCWSTR aURL); } diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 150d242..af6a124 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1616,6 +1616,35 @@ static nsresult NSAPI nsURI_SetIsDocumen return NS_OK; }
+static nsresult NSAPI nsURI_GetWineURL(nsIWineURI *iface, LPCWSTR *aURL) +{ + nsURI *This = NSURI_THIS(iface); + + TRACE("(%p)->(%p)\n", This, aURL); + + *aURL = This->wine_url; + return NS_OK; +} + +static nsresult NSAPI nsURI_SetWineURL(nsIWineURI *iface, LPCWSTR aURL) +{ + nsURI *This = NSURI_THIS(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_w(aURL)); + + mshtml_free(This->wine_url); + + if(aURL) { + int len = strlenW(aURL)+1; + This->wine_url = mshtml_alloc(len*sizeof(WCHAR)); + memcpy(This->wine_url, aURL, len*sizeof(WCHAR)); + }else { + This->wine_url = NULL; + } + + return NS_OK; +} + #undef NSURI_THIS
static const nsIWineURIVtbl nsWineURIVtbl = { @@ -1653,7 +1682,9 @@ static const nsIWineURIVtbl nsWineURIVtb nsURI_GetMoniker, nsURI_SetMoniker, nsURI_GetIsDocumentURI, - nsURI_SetIsDocumentURI + nsURI_SetIsDocumentURI, + nsURI_GetWineURL, + nsURI_SetWineURL };
static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIURI **_retval)