diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | win/tkWinDialog.c | 21 |
2 files changed, 15 insertions, 10 deletions
@@ -1,3 +1,7 @@ +2012-07-02 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 3540127]: filebox.test fails on win32 + 2012-06-26 Jan Nijtmans <nijtmans@users.sf.net> * unix/configure.in: Link cygwin wish.exe with win32 tk.dll, only 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); |