diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-01-19 05:01:04 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-01-19 05:01:04 +0800 |
commit | 391793b9bb2498599791b506f6c09080845ae7b0 (patch) | |
tree | b04c2bc3ab3689c95e19967d02ca3a7fe2c47986 /embed | |
parent | d125a79db5875e4328ea5e66af331197ad644f96 (diff) | |
download | gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.tar gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.tar.gz gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.tar.bz2 gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.tar.lz gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.tar.xz gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.tar.zst gsoc2013-epiphany-391793b9bb2498599791b506f6c09080845ae7b0.zip |
We need to use do_QueryInterface to get from the nsIDOM[Key|Mouse]Event to
2004-01-18 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/mozilla-embed.cpp:
We need to use do_QueryInterface to get from the
nsIDOM[Key|Mouse]Event to the nsIDOMEvent, not just
cast it.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 9cddf414c..421d0c194 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -826,13 +826,12 @@ mozilla_embed_dom_key_down_cb (GtkMozEmbed *embed, gpointer dom_event, } nsCOMPtr<nsIDOMKeyEvent> ev = static_cast<nsIDOMKeyEvent*>(dom_event); - if (!ev) - { - return FALSE; - } + NS_ENSURE_TRUE (ev, FALSE); + nsCOMPtr<nsIDOMEvent> dev = do_QueryInterface (ev); + NS_ENSURE_TRUE (dev, FALSE); MozillaEmbedEvent *info; - info = mozilla_embed_event_new (dom_event); + info = mozilla_embed_event_new (NS_STATIC_CAST (gpointer, dev)); gboolean ret = FALSE; @@ -892,12 +891,15 @@ mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event, return FALSE; } - info = mozilla_embed_event_new (dom_event); - + nsCOMPtr<nsIDOMMouseEvent> ev = static_cast<nsIDOMMouseEvent*>(dom_event); + NS_ENSURE_TRUE (ev, FALSE); + nsCOMPtr<nsIDOMEvent> dev = do_QueryInterface (ev); + NS_ENSURE_TRUE (dev, FALSE); + + info = mozilla_embed_event_new (NS_STATIC_CAST (gpointer, dev)); + event_context.Init (mpriv->browser); - result = event_context.GetMouseEventInfo - (static_cast<nsIDOMMouseEvent*>(dom_event), - MOZILLA_EMBED_EVENT (info)); + result = event_context.GetMouseEventInfo (ev, MOZILLA_EMBED_EVENT (info)); if (NS_SUCCEEDED(result)) { @@ -938,12 +940,15 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event, return FALSE; } - info = mozilla_embed_event_new (dom_event); - + nsCOMPtr<nsIDOMMouseEvent> ev = static_cast<nsIDOMMouseEvent*>(dom_event); + NS_ENSURE_TRUE (ev, FALSE); + nsCOMPtr<nsIDOMEvent> dev = do_QueryInterface (ev); + NS_ENSURE_TRUE (dev, FALSE); + + info = mozilla_embed_event_new (NS_STATIC_CAST (gpointer, dev)); + event_context.Init (mpriv->browser); - result = event_context.GetMouseEventInfo - (static_cast<nsIDOMMouseEvent*>(dom_event), - MOZILLA_EMBED_EVENT (info)); + result = event_context.GetMouseEventInfo (ev, MOZILLA_EMBED_EVENT (info)); if (NS_FAILED (result)) return FALSE; type = ephy_embed_event_get_event_type ((EphyEmbedEvent *) info); |