mshtml: Added IHTMLTxtRange::get_htmlText implementation.

This commit is contained in:
Jacek Caban 2007-05-10 00:34:05 +02:00 committed by Alexandre Julliard
parent 573d612de4
commit f0649f3731
2 changed files with 41 additions and 3 deletions

View File

@ -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;
@ -586,6 +585,15 @@ interface nsIDOMText : nsIDOMCharacterData
nsresult SplitText(PRUint32 offset, nsIDOMText **_retval);
}
[
object,
uuid(a6cf9076-15b3-11d2-932e-00805f8add32)
/* NOT_FROZEN */
]
interface nsIDOMDocumentFragment : nsIDOMNode
{
}
[
object,
uuid(a6cf9075-15b3-11d2-932e-00805f8add32)

View File

@ -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)