From 8712ee6eea8e52c66a5d6e8a72804026e0303dbe Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Sat, 13 Aug 2022 12:10:40 +0200 Subject: [PATCH] Remove unneccessary function argument --- src/ippprinter.cpp | 16 ++++++++-------- src/ippprinter.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index a7c9119..76e9e51 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -419,16 +419,16 @@ QString targetFormatIfAuto(QString documentFormat, QString mimeType, QJsonArray return documentFormat; } -void IppPrinter::adjustRasterSettings(QString filename, QString mimeType, QString documentFormat, QJsonObject& jobAttrs, PrintParameters& Params) +void IppPrinter::adjustRasterSettings(QString filename, QString mimeType, QJsonObject& jobAttrs, PrintParameters& Params) { - if(documentFormat != Mimer::PWG && documentFormat != Mimer::URF) + if(Params.format != PrintParameters::PWG && Params.format != PrintParameters::URF) { return; } jobAttrs.remove("printer-resolution"); - if(documentFormat == Mimer::PWG) + if(Params.format == PrintParameters::PWG) { quint32 diff = std::numeric_limits::max(); quint32 AdjustedHwResX = Params.hwResW; @@ -451,8 +451,8 @@ void IppPrinter::adjustRasterSettings(QString filename, QString mimeType, QStrin Params.hwResW = AdjustedHwResX; Params.hwResH = AdjustedHwResY; } - else if(documentFormat == Mimer::URF) - { // Ensure symmetric resolution for URF + else if(Params.format == PrintParameters::URF) + { // Ensure Params.format resolution for URF Params.hwResW = Params.hwResH = std::min(Params.hwResW, Params.hwResH); quint32 diff = std::numeric_limits::max(); @@ -485,7 +485,7 @@ void IppPrinter::adjustRasterSettings(QString filename, QString mimeType, QStrin if(Sides != "" && Sides != "one-sided") { - if(documentFormat == Mimer::PWG) + if(Params.format == PrintParameters::PWG) { QString DocumentSheetBack = _attrs["pwg-raster-document-sheet-back"].toObject()["value"].toString(); if(Sides=="two-sided-long-edge") @@ -513,7 +513,7 @@ void IppPrinter::adjustRasterSettings(QString filename, QString mimeType, QStrin } } } - else if(documentFormat == Mimer::URF) + else if(Params.format == PrintParameters::URF) { QJsonArray URfSupported = _attrs["urf-supported"].toObject()["value"].toArray(); if(Sides=="two-sided-long-edge") @@ -738,7 +738,7 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) } } - adjustRasterSettings(filename, mimeType, targetFormat, jobAttrs, Params); + adjustRasterSettings(filename, mimeType, jobAttrs, Params); QString Sides = getAttrOrDefault(jobAttrs, "sides").toString(); diff --git a/src/ippprinter.h b/src/ippprinter.h index 9a17c65..70dd49f 100644 --- a/src/ippprinter.h +++ b/src/ippprinter.h @@ -107,7 +107,7 @@ private: QJsonObject opAttrs(); - void adjustRasterSettings(QString filename, QString mimeType, QString documentFormat, QJsonObject& jobAttrs, PrintParameters& Params); + void adjustRasterSettings(QString filename, QString mimeType, QJsonObject& jobAttrs, PrintParameters& Params); void setBusyMessage(QString msg); void setProgress(qint64 sent, qint64 total);