diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java index 16b38fd6586..cf323036dde 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java @@ -35,6 +35,7 @@ *
* * @see Transfer + * @since 3.124 */ public class TextTransfer extends ByteArrayTransfer { @@ -42,9 +43,11 @@ public class TextTransfer extends ByteArrayTransfer { private static final String COMPOUND_TEXT = "COMPOUND_TEXT"; //$NON-NLS-1$ private static final String UTF8_STRING = "UTF8_STRING"; //$NON-NLS-1$ private static final String STRING = "STRING"; //$NON-NLS-1$ + private static final String TEXT_PLAIN_UTF8 = "text/plain;charset=utf-8"; private static final int COMPOUND_TEXT_ID = GTK.GTK4 ? 0 : registerType(COMPOUND_TEXT); private static final int UTF8_STRING_ID = GTK.GTK4 ? 0 : registerType(UTF8_STRING); private static final int STRING_ID = GTK.GTK4 ? 0 : registerType(STRING); + private static final int TEXT_PLAIN_UTF8_ID = GTK.GTK4 ? 0 : registerType(TEXT_PLAIN_UTF8); private TextTransfer() {} @@ -88,11 +91,10 @@ public void javaToNative (Object object, TransferData transferData) { transferData.pValue = ctext[0]; transferData.result = 1; } - if (transferData.type == UTF8_STRING_ID) { + if (transferData.type == UTF8_STRING_ID || transferData.type == TEXT_PLAIN_UTF8_ID) { long pValue = OS.g_malloc(utf8.length); if (pValue == 0) return; C.memmove(pValue, utf8, utf8.length); - transferData.type = UTF8_STRING_ID; transferData.format = 8; transferData.length = utf8.length - 1; transferData.pValue = pValue; @@ -109,6 +111,7 @@ public void javaToNative (Object object, TransferData transferData) { } } + /** * This implementation ofnativeToJava
converts a platform specific
* representation of plain text to a java String
.
@@ -145,7 +148,7 @@ protected int[] getTypeIds() {
if(GTK.GTK4) {
return new int[] {(int) OS.G_TYPE_STRING()};
}
- return new int[] {UTF8_STRING_ID, STRING_ID};
+ return new int[] {UTF8_STRING_ID, STRING_ID, TEXT_PLAIN_UTF8_ID};
}
@Override
@@ -157,7 +160,7 @@ protected String[] getTypeNames() {
return new String[] {"text/plain", STRING};
}
- return new String[] {UTF8_STRING, STRING};
+ return new String[] {UTF8_STRING, STRING, TEXT_PLAIN_UTF8};
}
boolean checkText(Object object) {
diff --git a/bundles/org.eclipse.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.swt/META-INF/MANIFEST.MF
index 10f89ee0b7d..af0d70829a1 100644
--- a/bundles/org.eclipse.swt/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.swt/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.swt; singleton:=true
-Bundle-Version: 3.124.100.qualifier
+Bundle-Version: 3.124.101.qualifier
Bundle-ManifestVersion: 2
Bundle-Localization: plugin
DynamicImport-Package: org.eclipse.swt.accessibility2
diff --git a/bundles/org.eclipse.swt/pom.xml b/bundles/org.eclipse.swt/pom.xml
index 2c20a72be1f..def77fedd48 100644
--- a/bundles/org.eclipse.swt/pom.xml
+++ b/bundles/org.eclipse.swt/pom.xml
@@ -21,7 +21,7 @@