qzint: getAsCLI: allow for setting GS1PARENS/GS1NOCHECK_MOD thru input_mode

This commit is contained in:
gitlost 2021-11-23 20:27:28 +00:00
parent 739a64a6ff
commit 61763d0cf3
2 changed files with 14 additions and 2 deletions

View File

@ -884,8 +884,8 @@ namespace Zint {
if (supportsGS1()) { if (supportsGS1()) {
arg_bool(cmd, "--gs1", (inputMode() & 0x07) == GS1_MODE); arg_bool(cmd, "--gs1", (inputMode() & 0x07) == GS1_MODE);
arg_bool(cmd, "--gs1parens", gs1Parens()); arg_bool(cmd, "--gs1parens", gs1Parens() || (inputMode() & GS1PARENS_MODE));
arg_bool(cmd, "--gs1nocheck", gs1NoCheck()); arg_bool(cmd, "--gs1nocheck", gs1NoCheck() || (inputMode() & GS1NOCHECK_MODE));
arg_bool(cmd, "--gssep", gsSep()); arg_bool(cmd, "--gssep", gsSep());
} }

View File

@ -735,6 +735,18 @@ private slots:
<< "zint.exe -b 145 -d \"\" --eci=20 --rotate=180 --vers=8" << "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" QTest::newRow("BARCODE_UPCE_CC") << true << 0.0f << "out.svg"
<< BARCODE_UPCE_CC << UNICODE_MODE // symbology-inputMode << BARCODE_UPCE_CC << UNICODE_MODE // symbology-inputMode
<< "12345670+1234" << "[11]901222[99]ABCDE" // text-primary << "12345670+1234" << "[11]901222[99]ABCDE" // text-primary