summaryrefslogtreecommitdiffstats
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)
commit584d22b78f9dc0e5505dec4d97e4b40ed0f95eef (patch)
tree6e838991ea20b33f0433925cbc66d2a261fef6da
parentafe14eb43d4dbd139287219224cb177b9347838c (diff)
parent65a269fcf2363cf08ce16e09eb22da3a67474820 (diff)
downloadtk-584d22b78f9dc0e5505dec4d97e4b40ed0f95eef.zip
tk-584d22b78f9dc0e5505dec4d97e4b40ed0f95eef.tar.gz
tk-584d22b78f9dc0e5505dec4d97e4b40ed0f95eef.tar.bz2
[Bug 3540127]: filebox.test fails on win32
-rw-r--r--ChangeLog4
-rw-r--r--win/tkWinDialog.c21
2 files changed, 15 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 5555ed6..b06d5ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);