From 61763d0cf3c628e136522b07d2331eef1dd12c5d Mon Sep 17 00:00:00 2001 From: gitlost Date: Tue, 23 Nov 2021 20:27:28 +0000 Subject: [PATCH] qzint: getAsCLI: allow for setting GS1PARENS/GS1NOCHECK_MOD thru input_mode --- backend_qt/qzint.cpp | 4 ++-- backend_qt/tests/test_qzint.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp index d2506787..4bd59943 100644 --- a/backend_qt/qzint.cpp +++ b/backend_qt/qzint.cpp @@ -884,8 +884,8 @@ namespace Zint { if (supportsGS1()) { arg_bool(cmd, "--gs1", (inputMode() & 0x07) == GS1_MODE); - arg_bool(cmd, "--gs1parens", gs1Parens()); - arg_bool(cmd, "--gs1nocheck", gs1NoCheck()); + arg_bool(cmd, "--gs1parens", gs1Parens() || (inputMode() & GS1PARENS_MODE)); + arg_bool(cmd, "--gs1nocheck", gs1NoCheck() || (inputMode() & GS1NOCHECK_MODE)); arg_bool(cmd, "--gssep", gsSep()); } diff --git a/backend_qt/tests/test_qzint.cpp b/backend_qt/tests/test_qzint.cpp index 34990fca..d6b94b8b 100644 --- a/backend_qt/tests/test_qzint.cpp +++ b/backend_qt/tests/test_qzint.cpp @@ -735,6 +735,18 @@ private slots: << "zint.exe -b 145 -d \"テ\" --eci=20 --rotate=180 --vers=8" << "" << ""; + QTest::newRow("BARCODE_ULTRA") << false << 0.0f << "" + << BARCODE_ULTRA << (GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE) // symbology-inputMode + << "(01)1" << "" // text-primary + << 0.0f << 6 << 2 << 0 << 1.0f << true << 0.8f // height-dotSize + << 5.0f << 2 << 1 << "4" << QColor(Qt::black) << QColor(Qt::white) // guardDescent-bgColor + << false << 0 << 0 << 0 << 0 << 0 // cmyk-fontSetting + << true << false << false << false << true << 0 // showText-rotateAngle + << 0 << false << false << false << WARN_DEFAULT << false // eci-debug + << "zint -b 144 -d '(01)1' --gs1 --gs1parens --gs1nocheck --secure=6 --structapp='1,2,4' --vers=2" + << "zint.exe -b 144 -d \"(01)1\" --gs1 --gs1parens --gs1nocheck --secure=6 --structapp=\"1,2,4\" --vers=2" + << "" << ""; + QTest::newRow("BARCODE_UPCE_CC") << true << 0.0f << "out.svg" << BARCODE_UPCE_CC << UNICODE_MODE // symbology-inputMode << "12345670+1234" << "[11]901222[99]ABCDE" // text-primary