Jacek Caban : mshtml: Added IHTMLStyle::[get|put]_cursor implementation.

Alexandre Julliard julliard at winehq.org
Tue Oct 7 08:53:52 CDT 2008


Module: wine
Branch: master
Commit: d7e693cdfa9c6eb95ad23332ced5625e2c49dcb4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d7e693cdfa9c6eb95ad23332ced5625e2c49dcb4

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Oct  6 09:50:46 2008 -0500

mshtml: Added IHTMLStyle::[get|put]_cursor implementation.

---

 dlls/mshtml/htmlstyle.c |   15 +++++++++++----
 dlls/mshtml/htmlstyle.h |    1 +
 dlls/mshtml/tests/dom.c |   16 ++++++++++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index f42b4d0..1f257a0 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -45,6 +45,8 @@ static const WCHAR attrBorderLeft[] =
     {'b','o','r','d','e','r','-','l','e','f','t',0};
 static const WCHAR attrColor[] =
     {'c','o','l','o','r',0};
+static const WCHAR attrCursor[] =
+    {'c','u','r','s','o','r',0};
 static const WCHAR attrDisplay[] =
     {'d','i','s','p','l','a','y',0};
 static const WCHAR attrFontFamily[] =
@@ -79,6 +81,7 @@ static const LPCWSTR style_strings[] = {
     attrBorder,
     attrBorderLeft,
     attrColor,
+    attrCursor,
     attrDisplay,
     attrFontFamily,
     attrFontSize,
@@ -1685,15 +1688,19 @@ static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
 {
     HTMLStyle *This = HTMLSTYLE_THIS(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    return set_style_attr(This, STYLEID_CURSOR, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
 {
     HTMLStyle *This = HTMLSTYLE_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_style_attr(This, STYLEID_CURSOR, p);
 }
 
 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 902cc9a..563187c 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -37,6 +37,7 @@ typedef enum {
     STYLEID_BORDER,
     STYLEID_BORDER_LEFT,
     STYLEID_COLOR,
+    STYLEID_CURSOR,
     STYLEID_DISPLAY,
     STYLEID_FONT_FAMILY,
     STYLEID_FONT_SIZE,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 1105f0f..1fcfa7c 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2118,6 +2118,22 @@ static void test_default_style(IHTMLStyle *style)
     ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v)));
     VariantClear(&v);
 
+    str = (void*)0xdeadbeef;
+    hres = IHTMLStyle_get_cursor(style, &str);
+    ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
+    ok(!str, "get_cursor != NULL\n");
+    SysFreeString(str);
+
+    str = a2bstr("default");
+    hres = IHTMLStyle_put_cursor(style, str);
+    ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
+    SysFreeString(str);
+
+    str = NULL;
+    hres = IHTMLStyle_get_cursor(style, &str);
+    ok(hres == S_OK, "get_cursor failed: %08x\n", hres);
+    ok(!strcmp_wa(str, "default"), "get_cursor returned %s\n", dbgstr_w(str));
+    SysFreeString(str);
 }
 
 static void test_default_selection(IHTMLDocument2 *doc)




More information about the wine-cvs mailing list