Bug 1425190 - Stop checking for GTK >= 2.24 in the printing code. r=karlt

MozReview-Commit-ID: CEvccM9YzgC
This commit is contained in:
Jonathan Watt 2017-12-08 09:44:17 +00:00
Родитель 8b2109ede1
Коммит 53631ea19f
1 изменённых файлов: 6 добавлений и 12 удалений

Просмотреть файл

@ -214,18 +214,12 @@ NS_IMETHODIMP nsPrintSettingsGTK::GetOutputFormat(int16_t *aOutputFormat)
return rv;
}
if (format == nsIPrintSettings::kOutputFormatNative) {
if (GTK_IS_PRINTER(mGTKPrinter)) {
// Prior to gtk 2.24, gtk_printer_accepts_pdf() and
// gtk_printer_accepts_ps() always returned true regardless of the
// printer's capability.
bool shouldTrustGTK =
(gtk_major_version > 2 ||
(gtk_major_version == 2 && gtk_minor_version >= 24));
bool acceptsPDF = shouldTrustGTK && gtk_printer_accepts_pdf(mGTKPrinter);
format = acceptsPDF ? nsIPrintSettings::kOutputFormatPDF
: nsIPrintSettings::kOutputFormatPS;
if (format == nsIPrintSettings::kOutputFormatNative &&
GTK_IS_PRINTER(mGTKPrinter)) {
if (gtk_printer_accepts_pdf(mGTKPrinter)) {
format = nsIPrintSettings::kOutputFormatPDF;
} else {
format = nsIPrintSettings::kOutputFormatPS;
}
}