summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Browser
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2010-04-16 18:40:42 +0000
committerGrant Gayed <ggayed>2010-04-16 18:40:42 +0000
commit73867f2cffacd6bfd26b673a67b443e1dc346e33 (patch)
tree611607b33bc9dd770eb4f4ace74c460b55a16161 /bundles/org.eclipse.swt/Eclipse SWT Browser
parentcbf30c52abe87cec4ed52641898abf66edc0ae82 (diff)
downloadeclipse.platform.swt-73867f2cffacd6bfd26b673a67b443e1dc346e33.tar.gz
eclipse.platform.swt-73867f2cffacd6bfd26b673a67b443e1dc346e33.tar.xz
eclipse.platform.swt-73867f2cffacd6bfd26b673a67b443e1dc346e33.zip
308496 - NullPointerException at org.eclipse.swt.browser.IE.handleDOMEvent
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Browser')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java43
1 files changed, 4 insertions, 39 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java
index d8af600cf6..b582f155a8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java
@@ -1463,45 +1463,10 @@ void handleDOMEvent (OleEvent e) {
lastKeyCode = translateKey (pVarResult.getInt());
pVarResult.dispose();
- boolean consume = false;
- OleAutomation document = null;
- OleAutomation htmlWindow2 = null;
- OleAutomation htmlEvent = null;
- /* get IHTMLDocument2 */
- rgdispid = auto.getIDsOfNames (new String[] {"Document"}); //$NON-NLS-1$
- pVarResult = auto.getProperty (rgdispid[0]);
- if (pVarResult == null || pVarResult.getType() == COM.VT_EMPTY) {
- if (pVarResult != null) pVarResult.dispose ();
- } else {
- document = pVarResult.getAutomation ();
- pVarResult.dispose ();
- /* get IHTMLWindow2 */
- rgdispid = document.getIDsOfNames (new String[] {"parentWindow"}); //$NON-NLS-1$
- pVarResult = document.getProperty (rgdispid[0]);
- if (pVarResult == null || pVarResult.getType () == COM.VT_EMPTY) {
- if (pVarResult != null) pVarResult.dispose ();
- } else {
- htmlWindow2 = pVarResult.getAutomation ();
- pVarResult.dispose ();
- /* get IHTMLEventObj */
- rgdispid = htmlWindow2.getIDsOfNames (new String[] {"event"}); //$NON-NLS-1$
- pVarResult = htmlWindow2.getProperty (rgdispid[0]);
- if (pVarResult == null || pVarResult.getType () == COM.VT_EMPTY) {
- if (pVarResult != null) pVarResult.dispose ();
- } else {
- htmlEvent = pVarResult.getAutomation ();
- pVarResult.dispose ();
- /* check event's returnValue property */
- rgdispid = htmlEvent.getIDsOfNames (new String[] {"returnValue"}); //$NON-NLS-1$
- pVarResult = htmlEvent.getProperty (rgdispid[0]);
- consume = pVarResult != null && pVarResult.getType () == OLE.VT_BOOL && !pVarResult.getBoolean ();
- pVarResult.dispose ();
- }
- }
- }
- if (htmlEvent != null) htmlEvent.dispose ();
- if (htmlWindow2 != null) htmlWindow2.dispose ();
- if (document != null) document.dispose ();
+ rgdispid = event.getIDsOfNames (new String[] {PROPERTY_RETURNVALUE});
+ pVarResult = event.getProperty (rgdispid[0]);
+ boolean consume = pVarResult != null && pVarResult.getType () == OLE.VT_BOOL && !pVarResult.getBoolean ();
+ pVarResult.dispose ();
MSG msg = new MSG ();
int flags = OS.PM_NOYIELD | (consume ? OS.PM_REMOVE : OS.PM_NOREMOVE);