<AWT Dev>  Review request for 8021943: FileDialog getFile returns corrupted string after previous setFile
Sergey.Bylokhov at oracle.com
Tue Aug 6 07:26:31 PDT 2013
Fix looks fine.
On 01.08.2013 21:03, Alexander Zvegintsev wrote:
> Could you please review a fix for the following issue:
> The fix is available at:
> lpstrFile should be treated as double NULL terminated (DNT) string
> only when OFN_ALLOWMULTISELECT flag is set.
>> If the *OFN_ALLOWMULTISELECT* flag is set and the user selects
>> multiple files, the buffer contains the current directory followed by
>> the file names of the selected files. For Explorer-style dialog
>> boxes, the directory and file name strings are *NULL* separated, with
>> an extra *NULL* character after the last file name.
> Currently we check length of a lpstrFile with GetBufferLength() which
> treats \0\0 as an end of a string.
> It works nice, unless we call setFile() with a filename longer than a
> path of a saved file (in single-select mode).
> In single-select mode lpstrFile string ends with single \0, and
> GetBufferLength() fails to find correct length and we pass
> \0-separated buffer to
> WFileDialogPeer.handleSelected() which will be treated as
> multi-select mode.
Best regards, Sergey.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev