Don't add resolution to IPP attrs if not set when adjusting for URF

This commit is contained in:
Anton Thomasson 2021-02-18 20:08:40 +01:00
parent e5b105a3c6
commit 86b580c15f

View file

@ -426,11 +426,15 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysConvert,
{ {
HwResX = HwResY; HwResX = HwResY;
} }
QJsonObject tmpObj;
tmpObj["units"] = PrinterResolutionRef.toObject()["units"]; if(attrs.contains("printer-resolution"))
tmpObj["x"] = (int)HwResX; {
tmpObj["y"] = (int)HwResY; QJsonObject tmpObj;
attrs["printer-resolution"] = QJsonObject { {"tag", IppMsg::Resolution}, {"value", tmpObj} }; tmpObj["units"] = PrinterResolutionRef.toObject()["units"];
tmpObj["x"] = (int)HwResX;
tmpObj["y"] = (int)HwResY;
attrs["printer-resolution"] = QJsonObject { {"tag", IppMsg::Resolution}, {"value", tmpObj} };
}
} }
quint32 Quality = getAttrOrDefault(attrs, "print-quality").toInt(); quint32 Quality = getAttrOrDefault(attrs, "print-quality").toInt();