Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2004-02-04 17:25:34 +0000
committerVeronika Irvine2004-02-04 17:25:34 +0000
commit578b397b120bc3bfc269118a7011f53d430e5127 (patch)
tree18a8e65e1cc4ecbfb9381d996f32a69a434f18c0
parent1589c741b6e043cc1691e5b9fb447394d31aee18 (diff)
downloadeclipse.platform.swt-578b397b120bc3bfc269118a7011f53d430e5127.tar.gz
eclipse.platform.swt-578b397b120bc3bfc269118a7011f53d430e5127.tar.xz
eclipse.platform.swt-578b397b120bc3bfc269118a7011f53d430e5127.zip
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java
index 465ae91cc5..88a0e318c7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java
@@ -250,12 +250,19 @@ public String[] getAvailableTypeNames() {
int[] atoms = new int[gtkSelectionData.length * 8 / gtkSelectionData.format];
OS.memmove(atoms, gtkSelectionData.data, gtkSelectionData.length);
String[] result = new String[atoms.length];
+ int count = 0;
for (int i = 0; i < atoms.length; i++) {
int pName = OS.gdk_atom_name(atoms[i]);
+ if (pName == 0) continue;
buffer = new byte [OS.strlen(pName)];
OS.memmove (buffer, pName, buffer.length);
OS.g_free (pName);
- result[i] = new String (Converter.mbcsToWcs (null, buffer));
+ result[count++] = new String (Converter.mbcsToWcs (null, buffer));
+ }
+ if (count < atoms.length) {
+ String[] temp = new String[count];
+ System.arraycopy(result, 0, temp, 0, count);
+ result = temp;
}
OS.gtk_selection_data_free(selection_data);
return result;

Back to the top