diff options
author | Veronika Irvine <veronika> | 2003-02-17 22:03:30 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2003-02-17 22:03:30 +0000 |
commit | 0f6a279d8f0e606baf0dda60047baac8466cb168 (patch) | |
tree | 9a2c98627a5c1e8af99a747906bfb3e2cf9374c8 /bundles/org.eclipse.swt/Eclipse SWT OLE Win32 | |
parent | 953d29677b1742c3d5df63a74e3e3a064c864b0a (diff) | |
download | eclipse.platform.swt-0f6a279d8f0e606baf0dda60047baac8466cb168.tar.gz eclipse.platform.swt-0f6a279d8f0e606baf0dda60047baac8466cb168.tar.xz eclipse.platform.swt-0f6a279d8f0e606baf0dda60047baac8466cb168.zip |
25619
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OLE Win32')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java index 98a5e313ff..b9269941ad 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java @@ -242,8 +242,10 @@ public void addEventListener(OleAutomation automation, int eventID, OleListener if (listener == null || automation == null) OLE.error (SWT.ERROR_NULL_ARGUMENT);
int address = automation.getAddress();
IUnknown unknown = new IUnknown(address);
- GUID guid = getDefaultEventSinkGUID(unknown);
- addEventListener(address, guid, eventID, listener);
+ GUID riid = getDefaultEventSinkGUID(unknown);
+ if (riid != null) {
+ addEventListener(address, riid, eventID, listener);
+ }
}
void addEventListener(int iunknown, GUID guid, int eventID, OleListener listener) {
@@ -664,8 +666,10 @@ public void removeEventListener(OleAutomation automation, int eventID, OleListen if (automation == null || listener == null) throw new SWTError (SWT.ERROR_NULL_ARGUMENT);
int address = automation.getAddress();
IUnknown unknown = new IUnknown(address);
- GUID guid = getDefaultEventSinkGUID(unknown);
- removeEventListener(address, guid, eventID, listener);
+ GUID riid = getDefaultEventSinkGUID(unknown);
+ if (riid != null) {
+ removeEventListener(address, riid, eventID, listener);
+ }
}
void removeEventListener(int iunknown, GUID guid, int eventID, OleListener listener) {
if (listener == null || guid == null) throw new SWTError (SWT.ERROR_NULL_ARGUMENT);
@@ -685,17 +689,17 @@ void removeEventListener(int iunknown, GUID guid, int eventID, OleListener liste } else {
OleEventSink[] newOleEventSink = new OleEventSink[oldLength - 1];
System.arraycopy(oleEventSink, 0, newOleEventSink, 0, i);
- System.arraycopy(oleEventSink, i + 1, newOleEventSink, 0, oldLength - i - 1);
+ System.arraycopy(oleEventSink, i + 1, newOleEventSink, i, oldLength - i - 1);
oleEventSink = newOleEventSink;
GUID[] newOleEventSinkGUID = new GUID[oldLength - 1];
System.arraycopy(oleEventSinkGUID, 0, newOleEventSinkGUID, 0, i);
- System.arraycopy(oleEventSinkGUID, i + 1, newOleEventSinkGUID, 0, oldLength - i - 1);
+ System.arraycopy(oleEventSinkGUID, i + 1, newOleEventSinkGUID, i, oldLength - i - 1);
oleEventSinkGUID = newOleEventSinkGUID;
int[] newOleEventSinkIUnknown = new int[oldLength - 1];
System.arraycopy(oleEventSinkIUnknown, 0, newOleEventSinkIUnknown, 0, i);
- System.arraycopy(oleEventSinkIUnknown, i + 1, newOleEventSinkIUnknown, 0, oldLength - i - 1);
+ System.arraycopy(oleEventSinkIUnknown, i + 1, newOleEventSinkIUnknown, i, oldLength - i - 1);
oleEventSinkIUnknown = newOleEventSinkIUnknown;
}
}
|