diff options
author | Grant Gayed <ggayed> | 2006-12-21 21:44:30 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2006-12-21 21:44:30 +0000 |
commit | dcf5e9859cd3a4f7d7e7f45c042c8c7f6599747a (patch) | |
tree | fb1a537834f57df8012a8d2a012c06da13e93277 | |
parent | d87aa72bc0c46b605438e02828d6de28ca8169b6 (diff) | |
download | eclipse.platform.swt-dcf5e9859cd3a4f7d7e7f45c042c8c7f6599747a.tar.gz eclipse.platform.swt-dcf5e9859cd3a4f7d7e7f45c042c8c7f6599747a.tar.xz eclipse.platform.swt-dcf5e9859cd3a4f7d7e7f45c042c8c7f6599747a.zip |
replace getBytes() with Converter
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java index 0599dcd72f..f6b8e59987 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java @@ -11,6 +11,7 @@ package org.eclipse.swt.browser; import org.eclipse.swt.*; +import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.mozilla.*; import org.eclipse.swt.widgets.*; @@ -101,9 +102,7 @@ Browser getBrowser(int aDOMWindow) { nsIServiceManager serviceManager = new nsIServiceManager(result[0]); result[0] = 0; - byte[] buffer = XPCOM.NS_WINDOWWATCHER_CONTRACTID.getBytes(); - byte[] aContractID = new byte[buffer.length + 1]; - System.arraycopy(buffer, 0, aContractID, 0, buffer.length); + byte[] aContractID = Converter.wcsToMbcs(null, XPCOM.NS_WINDOWWATCHER_CONTRACTID, true); rc = serviceManager.GetServiceByContractID(aContractID, nsIWindowWatcher.NS_IWINDOWWATCHER_IID, result); if (rc != XPCOM.NS_OK) Browser.error(rc); if (result[0] == 0) Browser.error(XPCOM.NS_NOINTERFACE); @@ -303,9 +302,7 @@ public int Prompt(int parent, int dialogTitle, int text, int value, int checkMsg nsIServiceManager serviceManager = new nsIServiceManager(result2[0]); result2[0] = 0; - byte[] tmp = XPCOM.NS_MEMORY_CONTRACTID.getBytes(); - byte[] aContractID = new byte[tmp.length + 1]; - System.arraycopy(tmp, 0, aContractID, 0, tmp.length); + byte[] aContractID = Converter.wcsToMbcs(null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result2); if (rc != XPCOM.NS_OK) SWT.error(rc); if (result2[0] == 0) SWT.error(XPCOM.NS_NOINTERFACE); @@ -397,9 +394,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int nsIServiceManager serviceManager = new nsIServiceManager(result[0]); result[0] = 0; - byte[] tmp = XPCOM.NS_MEMORY_CONTRACTID.getBytes(); - byte[] aContractID = new byte[tmp.length + 1]; - System.arraycopy(tmp, 0, aContractID, 0, tmp.length); + byte[] aContractID = Converter.wcsToMbcs(null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result); if (rc != XPCOM.NS_OK) SWT.error(rc); if (result[0] == 0) SWT.error(XPCOM.NS_NOINTERFACE); @@ -428,9 +423,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int nsIServiceManager serviceManager = new nsIServiceManager(result[0]); result[0] = 0; - byte[] tmp = XPCOM.NS_MEMORY_CONTRACTID.getBytes(); - byte[] aContractID = new byte[tmp.length + 1]; - System.arraycopy(tmp, 0, aContractID, 0, tmp.length); + byte[] aContractID = Converter.wcsToMbcs(null, XPCOM.NS_MEMORY_CONTRACTID, true); rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result); if (rc != XPCOM.NS_OK) SWT.error(rc); if (result[0] == 0) SWT.error(XPCOM.NS_NOINTERFACE); |