]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/filedlg.cpp
Update to docs incl. wxString first stab; added a couple of palette-related events...
[wxWidgets.git] / src / gtk1 / filedlg.cpp
index aa05bdac13fbc3c21e216fcd3b80b66706397c35..bc003c8185b18b2c66ad7956c7dd181e89578698 100644 (file)
@@ -25,8 +25,11 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
 {
   wxFileDialog *dialog = (wxFileDialog*)data;
   wxCommandEvent event(wxEVT_NULL);
+  int style;
 
-  if(dialog->GetStyle()&(wxSAVE|wxOVERWRITE_PROMPT))
+  style=dialog->GetStyle();
+
+  if((style&wxSAVE)&&(style&wxOVERWRITE_PROMPT))
        if(wxFileExists(gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog->m_widget) ))) {
          if(wxMessageBox("File exists. Overwrite?","Confirm",wxYES_NO)!=wxYES)
                return;
@@ -65,7 +68,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
   GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
 
   m_path.Append(m_dir);
-  if(m_path.Last()!='/') m_path.Append('/');
+  if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
   m_path.Append(m_fileName);
 
   if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path);