Fixes a small bug in Qt. ItemIndex didn't work for the last item, for example ItemIndex=15 with 15 items.

git-svn-id: trunk@27717 -
This commit is contained in:
sekelsenmat 2010-10-15 10:25:27 +00:00
parent 17cbc0d5bf
commit 409c85821c

View File

@ -269,7 +269,9 @@ begin
TmpFilter := TmpFilter + ' ' + strExtensions;
end;
if (AFileDialog.FilterIndex > 0) and (List.Count > AFileDialog.FilterIndex) then
// Remember that AFileDialog.FilterIndex is a 1-based index and that
// List has a zero-based index
if (AFileDialog.FilterIndex > 0) and (List.Count >= AFileDialog.FilterIndex) then
ASelectedFilter := GetUTF8String(List.Strings[AFileDialog.FilterIndex - 1])
else
if (List.Count > 0) then