aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2014-07-14 06:43:51 (EDT)
committerSravan Kumar Lakkimsetti2014-08-06 07:10:40 (EDT)
commit96b3248ea15701f75658a6752326913665b0beee (patch)
treeb2432cec313dce44e76f1382392c93b09e18ac12
parent59468bce01c59cfa643e615ac77a6b70ac68c231 (diff)
downloadeclipse.platform.swt-96b3248ea15701f75658a6752326913665b0beee.zip
eclipse.platform.swt-96b3248ea15701f75658a6752326913665b0beee.tar.gz
eclipse.platform.swt-96b3248ea15701f75658a6752326913665b0beee.tar.bz2
Bug 408953 - gtk : Clear text in Text.getTextChars()refs/changes/91/31091/1
Change-Id: I7ac17b9afcc06ceb61e461a92bfdfa42df01e757 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index ba8e9dc..7af51b7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -11,6 +11,8 @@
package org.eclipse.swt.widgets;
+import java.util.Arrays;
+
import org.eclipse.swt.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.cairo.*;
@@ -706,6 +708,7 @@ char [] deprocessText (char [] text, int start, int end) {
if (start != 0 || end != start + length) {
char [] newText = new char [length];
System.arraycopy(text, 0, newText, 0, length);
+ Arrays.fill (text, (char) 0);
return newText;
}
return text;
@@ -1315,10 +1318,13 @@ public char [] getTextChars () {
byte [] buffer = new byte [length];
OS.memmove (buffer, address, length);
if ((style & SWT.MULTI) != 0) OS.g_free (address);
+
+ char [] result = Converter.mbcsToWcs (null, buffer);
+ Arrays.fill (buffer, (byte) 0);
if (segments != null) {
- return deprocessText (Converter.mbcsToWcs (null, buffer), 0, -1);
+ result = deprocessText (result, 0, -1);
}
- return Converter.mbcsToWcs (null, buffer);
+ return result;
}
/**