diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-07-04 12:54:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-07-04 12:54:56 (GMT) |
commit | 584d22b78f9dc0e5505dec4d97e4b40ed0f95eef (patch) | |
tree | 6e838991ea20b33f0433925cbc66d2a261fef6da /win | |
parent | afe14eb43d4dbd139287219224cb177b9347838c (diff) | |
parent | 65a269fcf2363cf08ce16e09eb22da3a67474820 (diff) | |
download | tk-584d22b78f9dc0e5505dec4d97e4b40ed0f95eef.zip tk-584d22b78f9dc0e5505dec4d97e4b40ed0f95eef.tar.gz tk-584d22b78f9dc0e5505dec4d97e4b40ed0f95eef.tar.bz2 |
[Bug 3540127]: filebox.test fails on win32
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinDialog.c | 21 |
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); |