提交 766bebff 编写于 作者: P pchelko

8021943: FileDialog getFile returns corrupted string after previous setFile

Reviewed-by: anthony, serb
Contributed-by: alexander.zvegintsev@oracle.com
上级 ee6ca6fd
......@@ -372,7 +372,9 @@ AwtFileDialog::Show(void *p)
// Report result to peer.
if (result) {
jint length = (jint)GetBufferLength(ofn.lpstrFile, ofn.nMaxFile);
jint length = multipleMode
? (jint)GetBufferLength(ofn.lpstrFile, ofn.nMaxFile)
: (jint)_tcslen(ofn.lpstrFile);
jcharArray jnames = env->NewCharArray(length);
env->SetCharArrayRegion(jnames, 0, length, (jchar*)ofn.lpstrFile);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册