Selected filter in TSaveDialog sets wrong extension, returns wrong index
Original Reporter info from Mantis: hobbestherat
-
Reporter name: Thomas Frey
Original Reporter info from Mantis: hobbestherat
- Reporter name: Thomas Frey
Description:
TSaveDialog item indexes are 1 based, the index in Carbon is 0 based. The index is not re-based to 1 when returning from
class procedure TCarbonWSFileDialog.ShowModal(const ACommonDialog: TCommonDialog);
Suggested fix:
replace
FileDialog.FilterIndex := FilterIndex;
by
FileDialog.FilterIndex := FilterIndex + 1;
in
carbonwsdialogs.pp (TCarbonWSFileDialog.ShowModal)
Steps to reproduce:
Place a TSaveDialog on a form. Add 3 filters and print the returned file name plus filter index. Run, select 2nd filter and give a name, close the dialog with save.
Expected result: file name should have the extension of the second filter and filter index should be 2. Observed result: extension is of the first filter, filter index is 1.
Mantis conversion info:
- Mantis ID: 25086
- OS: OSX
- Platform: MAC
- Version: 1.0.10
- Fixed in version: 1.3 (SVN)
- Fixed in revision: 403061
- Monitored by: » hobbestherat (Thomas Frey)
- Target version: 1.2.0
- LazTarget: 1.2