mirror of
https://gitee.com/openharmony/print_print_fwk
synced 2024-11-23 08:59:47 +00:00
增加非法参数的处理
Signed-off-by: shanhaiyang <shanhaiyang@huawei.com>
This commit is contained in:
parent
c57fb09756
commit
1c08fc9cb4
@ -616,7 +616,12 @@ void SetOptionInPrintJob(const Print_PrintJob &nativePrintJob, PrintJob &printJo
|
||||
jsonOptions["mediaType"] = std::string(nativePrintJob.mediaType);
|
||||
}
|
||||
jsonOptions["borderless"] = nativePrintJob.borderless ? "true" : "false";
|
||||
jsonOptions["printQuality"] = nativePrintJob.printQuality;
|
||||
Print_Quality quality = nativePrintJob.printQuality;
|
||||
if (quality > static_cast<Print_Quality>(PRINT_QUALITY_HIGH)
|
||||
|| quality < static_cast<Print_Quality>(PRINT_QUALITY_DRAFT)) {
|
||||
quality = static_cast<Print_Quality>(PRINT_QUALITY_NORMAL);
|
||||
}
|
||||
jsonOptions["printQuality"] = quality;
|
||||
jsonOptions["documentFormat"] = GetDocumentFormatString(nativePrintJob.documentFormat);
|
||||
if (nativePrintJob.advancedOptions != nullptr) {
|
||||
jsonOptions["cupsOptions"] = std::string(nativePrintJob.advancedOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user