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 | |
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
-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); |