X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9838df2cefc5b368bb11f98c784ecc78f45ecaf7..e4ffaca45548c79ee89dce9779b79e2d25c6f068:/src/generic/prntdlgg.cpp diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp index f7dc47a9df..5a89abe6e5 100644 --- a/src/generic/prntdlgg.cpp +++ b/src/generic/prntdlgg.cpp @@ -156,14 +156,14 @@ void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { wxThePrintSetupData->SetPrinterMode(PS_FILE); - char *f = wxFileSelector(_("PostScript file"), - wxPathOnly(wxThePrintSetupData->GetPrinterFile()), - wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()), - "ps", "*.ps", 0, this); - if (f) - wxThePrintSetupData->SetPrinterFile(f); - else - return; + wxString f = wxFileSelector(_("PostScript file"), + wxPathOnly(wxThePrintSetupData->GetPrinterFile()), + wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()), + "ps", "*.ps", 0, this); + if ( f.IsEmpty() ) + return; + + wxThePrintSetupData->SetPrinterFile(f); } else wxThePrintSetupData->SetPrinterMode(PS_PRINTER); @@ -425,7 +425,7 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event)) wxPrintData data; data.SetSetupDialog(TRUE); wxPrintDialog *printDialog = new wxPrintDialog(this, & data); - int ret = printDialog->ShowModal(); + printDialog->ShowModal(); printDialog->Destroy();