summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-02-21 13:32:14 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-02-21 13:32:14 (GMT)
commit5dc9eda8fddc543ffbadf2ccbad69fc4d1051da3 (patch)
treed7ea6a459ceb5b8b417f33f5a340fd4149c73cbb
parent3c47b004b554800175263bae571beaf641f6954a (diff)
downloadtk-5dc9eda8fddc543ffbadf2ccbad69fc4d1051da3.zip
tk-5dc9eda8fddc543ffbadf2ccbad69fc4d1051da3.tar.gz
tk-5dc9eda8fddc543ffbadf2ccbad69fc4d1051da3.tar.bz2
* library/comdlg.tcl (FDGetFileTypes): Set an upper limit on how
long a file type item description string can get due to appending of types. [Bug #617392]
-rw-r--r--ChangeLog4
-rw-r--r--library/comdlg.tcl12
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b33e59..82e94ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2003-02-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+ * library/comdlg.tcl (FDGetFileTypes): Set an upper limit on how
+ long a file type item description string can get due to appending
+ of types. [Bug #617392]
+
* tests/panedwindow.test (panedwindow-30.1):
* generic/tkPanedWindow.c (DisplayPanedWindow, DisplayProxyWindow):
Use the window's depth, not the screen's default depth. [Bug #671122]
diff --git a/library/comdlg.tcl b/library/comdlg.tcl
index cb2af18..9cc5d74 100644
--- a/library/comdlg.tcl
+++ b/library/comdlg.tcl
@@ -3,7 +3,7 @@
# Some functions needed for the common dialog boxes. Probably need to go
# in a different file.
#
-# RCS: @(#) $Id: comdlg.tcl,v 1.8 2001/08/01 16:21:11 dgp Exp $
+# RCS: @(#) $Id: comdlg.tcl,v 1.9 2003/02/21 13:32:14 dkf Exp $
#
# Copyright (c) 1996 Sun Microsystems, Inc.
#
@@ -281,13 +281,21 @@ proc ::tk::FDGetFileTypes {string} {
set name "$label ("
set sep ""
+ set doAppend 1
foreach ext $fileTypes($label) {
if {[string equal $ext ""]} {
continue
}
regsub {^[.]} $ext "*." ext
if {![info exists hasGotExt($label,$ext)]} {
- append name $sep$ext
+ if {$doAppend} {
+ if {[string length $sep] && [string length $name]>40} {
+ set doAppend 0
+ append name $sep...
+ } else {
+ append name $sep$ext
+ }
+ }
lappend exts $ext
set hasGotExt($label,$ext) 1
}