Commit f0649f37 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLTxtRange::get_htmlText implementation.

parent 573d612d
......@@ -97,7 +97,6 @@ typedef nsISupports nsIDOMNamedNodeMap;
typedef nsISupports nsIDOMAttr;
typedef nsISupports nsIDOMDocumentType;
typedef nsISupports nsIDOMDOMImplementation;
typedef nsISupports nsIDOMDocumentFragment;
typedef nsISupports nsIDOMComment;
typedef nsISupports nsIDOMCDATASection;
typedef nsISupports nsIDOMProcessingInstruction;
......@@ -588,6 +587,15 @@ interface nsIDOMText : nsIDOMCharacterData
[
object,
uuid(a6cf9076-15b3-11d2-932e-00805f8add32)
/* NOT_FROZEN */
]
interface nsIDOMDocumentFragment : nsIDOMNode
{
}
[
object,
uuid(a6cf9075-15b3-11d2-932e-00805f8add32)
/* FROZEN */
]
......
......@@ -138,8 +138,38 @@ static HRESULT WINAPI HTMLTxtRange_Invoke(IHTMLTxtRange *iface, DISPID dispIdMem
static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p)
{
HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
*p = NULL;
if(This->nsrange) {
nsIDOMDocumentFragment *fragment;
nsresult nsres;
nsres = nsIDOMRange_CloneContents(This->nsrange, &fragment);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *nstext;
nsAString nsstr;
nsAString_Init(&nsstr, NULL);
nsnode_to_nsstring((nsIDOMNode*)fragment, &nsstr);
nsIDOMDocumentFragment_Release(fragment);
nsAString_GetData(&nsstr, &nstext, NULL);
*p = SysAllocString(nstext);
nsAString_Finish(&nsstr);
}
}
if(!*p) {
const WCHAR emptyW[] = {0};
*p = SysAllocString(emptyW);
}
TRACE("return %s\n", debugstr_w(*p));
return S_OK;
}
static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment