diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2003-02-21 13:32:14 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2003-02-21 13:32:14 (GMT) |
commit | e2a49ec8f224bc9f053d5abf667434ec7491913b (patch) | |
tree | d7ea6a459ceb5b8b417f33f5a340fd4149c73cbb /library/comdlg.tcl | |
parent | d731b2169c7ad08a190f54801b9f189515025f28 (diff) | |
download | tk-e2a49ec8f224bc9f053d5abf667434ec7491913b.zip tk-e2a49ec8f224bc9f053d5abf667434ec7491913b.tar.gz tk-e2a49ec8f224bc9f053d5abf667434ec7491913b.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]
Diffstat (limited to 'library/comdlg.tcl')
-rw-r--r-- | library/comdlg.tcl | 12 |
1 files changed, 10 insertions, 2 deletions
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 } |