summaryrefslogtreecommitdiffstats
path: root/win/tkWinDialog.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-04 12:54:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-04 12:54:56 (GMT)
commitbe9a934977e9b86a773e57821d4a3d2de77f4282 (patch)
tree6e838991ea20b33f0433925cbc66d2a261fef6da /win/tkWinDialog.c
parent022243628900981f92cc595cfefbf7f7b66f51a6 (diff)
parent9ab3c6cd92aab67f7d99a976591c138c03c7fa66 (diff)
downloadtk-be9a934977e9b86a773e57821d4a3d2de77f4282.zip
tk-be9a934977e9b86a773e57821d4a3d2de77f4282.tar.gz
tk-be9a934977e9b86a773e57821d4a3d2de77f4282.tar.bz2
[Bug 3540127]: filebox.test fails on win32
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r--win/tkWinDialog.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 67fc637..7d39e61 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -586,21 +586,16 @@ GetFileName(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
static const char *const saveOptionStrings[] = {
- "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", "-typevariable",
- "-confirmoverwrite",
- NULL
+ "-confirmoverwrite", "-defaultextension", "-filetypes", "-initialdir",
+ "-initialfile", "-parent", "-title", "-typevariable", NULL
};
static const char *const openOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", "-typevariable",
- "-multiple",
- NULL
+ "-multiple", "-parent", "-title", "-typevariable", NULL
};
enum options {
- FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE,
- FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE,
- FILE_MULTIPLE_OR_CONFIRMOW
+ FILE_MULTIPLE_OR_CONFIRMOW, FILE_DEFAULT, FILE_TYPES, FILE_INITDIR,
+ FILE_INITFILE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE
};
file[0] = '\0';
@@ -621,6 +616,12 @@ GetFileName(
"option", 0, &index) != TCL_OK) {
goto end;
}
+ /* Compensate for the "openOptionStrings" having different ordering [Bug #3540127] */
+ if (open && (index < FILE_PARENT)) {
+ if (++index > FILE_INITFILE) {
+ index = FILE_MULTIPLE_OR_CONFIRMOW;
+ }
+ }
if (i + 1 == objc) {
string = Tcl_GetString(optionPtr);