diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-06-18 15:21:00 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-06-18 15:22:52 -0400 |
commit | 6cfe3d127e0b01ad97a0805575f2dfaa61a02410 (patch) | |
tree | 12501248c7a43286b2832fc8bf798f3a7725ca54 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | f5471f1dce5662b63a70164ff03da95148af503a (diff) | |
download | eclipse.platform.swt-6cfe3d127e0b01ad97a0805575f2dfaa61a02410.tar.gz eclipse.platform.swt-6cfe3d127e0b01ad97a0805575f2dfaa61a02410.tar.xz eclipse.platform.swt-6cfe3d127e0b01ad97a0805575f2dfaa61a02410.zip |
Bug 376448 - [DBCS4.2] AIX 7, DirectoryDialog returns 'null' if selected
path contains DBCS characters
Bug 377246 - [DBCS] AIX 7: FileDialog returns 'null' if selected path
contains DBCS characters
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java | 3 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java index b6979e12a8..cd4060359a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java @@ -200,7 +200,8 @@ String openChooserDialog () { int /*long*/ path = OS.gtk_file_chooser_get_filename (handle); if (path != 0) { int /*long*/ utf8Ptr = OS.g_filename_to_utf8 (path, -1, null, null, null); - OS.g_free (path); + if (utf8Ptr == 0) utf8Ptr = OS.g_filename_display_name (path); + if (path != utf8Ptr) OS.g_free (path); if (utf8Ptr != 0) { int /*long*/ [] items_written = new int /*long*/ [1]; int /*long*/ utf16Ptr = OS.g_utf8_to_utf16 (utf8Ptr, -1, null, items_written, null); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java index 0a0c755a20..b57f25accb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/FileDialog.java @@ -119,8 +119,9 @@ String computeResultChooserDialog () { utf8Ptr = name; } else { utf8Ptr = OS.g_filename_to_utf8 (name, -1, null, null, null); - OS.g_free (name); + if (utf8Ptr == 0) utf8Ptr = OS.g_filename_display_name (name); } + if (name != utf8Ptr) OS.g_free (name); if (utf8Ptr != 0) { int /*long*/ [] items_written = new int /*long*/ [1]; int /*long*/ utf16Ptr = OS.g_utf8_to_utf16 (utf8Ptr, -1, null, items_written, null); @@ -150,7 +151,8 @@ String computeResultChooserDialog () { int /*long*/ path = OS.gtk_file_chooser_get_filename (handle); if (path != 0) { utf8Ptr = OS.g_filename_to_utf8 (path, -1, null, null, null); - OS.g_free (path); + if (utf8Ptr == 0) utf8Ptr = OS.g_filename_display_name (path); + if (path != utf8Ptr) OS.g_free (path); } } if (utf8Ptr != 0) { |