Jacek Caban : mshtml: Added get_text implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jul 6 06:09:09 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 3c1f2d6cbe942fac816e2dd284a611f89ac5c06d
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=3c1f2d6cbe942fac816e2dd284a611f89ac5c06d
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Jul 5 22:38:20 2006 +0200
mshtml: Added get_text implementation.
---
dlls/mshtml/txtrange.c | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/txtrange.c b/dlls/mshtml/txtrange.c
index ea2319e..58b4391 100644
--- a/dlls/mshtml/txtrange.c
+++ b/dlls/mshtml/txtrange.c
@@ -152,8 +152,26 @@ static HRESULT WINAPI HTMLTxtRange_put_t
static HRESULT WINAPI HTMLTxtRange_get_text(IHTMLTxtRange *iface, BSTR *p)
{
HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ PRUnichar *nstext = NULL;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ if(!This->nsselection) {
+ static const WCHAR empty[] = {0};
+ *p = SysAllocString(empty);
+ return S_OK;
+ }
+
+ nsres = nsISelection_ToString(This->nsselection, &nstext);
+ if(NS_FAILED(nsres) || !nstext) {
+ ERR("toString failed: %08lx\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = SysAllocString(nstext);
+ nsfree(nstext);
+ return S_OK;
}
static HRESULT WINAPI HTMLTxtRange_parentElement(IHTMLTxtRange *iface, IHTMLElement **parent)
More information about the wine-cvs
mailing list