Bug 413462 - "GTK print dialog has incorrect filename extension for Print to File" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r+sr=roc a1.9=damons]

This commit is contained in:
reed@reedloden.com 2008-02-09 22:07:34 -08:00
parent e849206e70
commit a00043f6e5

View File

@ -430,6 +430,12 @@ nsPrintSettingsGTK::SetToFileName(const PRUnichar * aToFileName)
return NS_OK;
}
if (StringEndsWith(nsDependentString(aToFileName), NS_LITERAL_STRING(".ps"))) {
gtk_print_settings_set(mPrintSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT, "ps");
} else {
gtk_print_settings_set(mPrintSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT, "pdf");
}
nsCOMPtr<nsILocalFile> file;
NS_NewLocalFile(nsDependentString(aToFileName), PR_TRUE, getter_AddRefs(file));