From: Gert Driesen Date: Thu, 23 Aug 2007 16:16:12 +0000 (-0000) Subject: * FileDialog.cs: When Save/Open is clicked and no filename is selected X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=559df233958ef5d59b0ccfc4cb0b3a32478794a3;hp=570677df09894dbf2df7781229503e6b6bb4a0c9;p=mono.git * FileDialog.cs: When Save/Open is clicked and no filename is selected or entered then do not close the dialog. Fixes bug #82539. Removed CWLs. svn path=/trunk/mcs/; revision=84715 --- diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index ef2c3c7a126..eea110c17d0 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,9 @@ +2007-08-23 Gert Driesen + + * FileDialog.cs: When Save/Open is clicked and no filename is selected + or entered then do not close the dialog. Fixes bug #82539. Removed + CWLs. + 2007-08-22 Everaldo Canuto * FileDialog.cs: Create UpdateRecentFiles and move the recent files refresh diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs index d6147624abf..edd5bae7842 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs @@ -949,6 +949,8 @@ namespace System.Windows.Forms // remove items above the maximum items that we want to display while (fileNameComboBox.Items.Count > MaxFileNameItems) fileNameComboBox.Items.RemoveAt (MaxFileNameItems); + } else { + return; } if (checkPathExists && mwfFileView.CurrentRealFolder != null) { @@ -1189,7 +1191,6 @@ namespace System.Windows.Forms private void UpdateRecentFiles () { - Console.WriteLine ("UpdateRecentFiles"); fileNameComboBox.Items.Clear (); if (configFileNames != null) { foreach (string configFileName in configFileNames) { @@ -1199,7 +1200,6 @@ namespace System.Windows.Forms if (fileNameComboBox.Items.Count >= MaxFileNameItems) break; fileNameComboBox.Items.Add (configFileName); -Console.WriteLine ("> {0} {1}", GetExtension (configFileName), configFileName); } } } @@ -3419,20 +3419,20 @@ Console.WriteLine ("> {0} {1}", GetExtension (configFileName), configFileName); directories_out = new ArrayList (); DirectoryInfo[] dirs = null; - + try { dirs = dirinfo.GetDirectories (); } catch (Exception) {} - + if (dirs != null) for (int i = 0; i < dirs.Length; i++) { directories_out.Add (GetDirectoryFSEntry (dirs [i], currentTopFolderFSEntry)); } - + files_out = new ArrayList (); ArrayList files = new ArrayList (); - + try { if (filters == null) { files.AddRange (dirinfo.GetFiles ()); @@ -3443,14 +3443,14 @@ Console.WriteLine ("> {0} {1}", GetExtension (configFileName), configFileName); files.Sort (fileInfoComparer); } } catch (Exception) {} - + for (int i = 0; i < files.Count; i++) { FSEntry fs = GetFileFSEntry (files [i] as FileInfo); if (fs != null) files_out.Add (fs); } } - + protected ArrayList GetNormalFolders (string from_folder) { DirectoryInfo dirinfo = new DirectoryInfo (from_folder);