1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-17 18:07:02 +00:00

Add compliant height, using ZINT_COMPLIANT_HEIGHT flag for back-compatibility

Rename barcode funcs to same as BARCODE_XXX name
library: barcode funcs array for dispatch, used for ZBarcode_ValidID() also
general: change is_sane() comparison to nonzero from ZINT_ERROR_INVALID_OPTION
MAILMARK: fuller error messages
CODABAR: add option to show check character in HRT
zint.h: use 0xNNNN for OR-able defines
GUI: add guard descent height reset button, add Zint version to window title,
  static get_zint_version() method, use QStringLiteral (QSL shorthand),
  use SIGNAL(toggled()), add errtxt "popup" and status bar, add icons,
  add saveAs shortcut, add main menu, context menus and actions, add help,
  reset_view() -> reset_colours(), add copy to clipboard as EMF/GIF/PNG/TIF,
  lessen triggering of update_preview(), shorten names of getters/setters,
  simplify/shorten some update_preview() logic in switch,
  CODEONE disable structapp for Version S
qzint.cpp: add on_errored signal, add missing getters, add test
This commit is contained in:
gitlost
2021-10-09 00:13:39 +01:00
parent 206ae26d20
commit 72eac41c34
82 changed files with 5570 additions and 3774 deletions

View File

@@ -957,7 +957,7 @@ static void block_copy(struct zint_symbol *symbol, char datagrid[136][120], cons
}
}
INTERNAL int code_one(struct zint_symbol *symbol, unsigned char source[], int length) {
INTERNAL int codeone(struct zint_symbol *symbol, unsigned char source[], int length) {
int size = 1, i, j;
char datagrid[136][120];
@@ -972,6 +972,10 @@ INTERNAL int code_one(struct zint_symbol *symbol, unsigned char source[], int le
}
if (symbol->structapp.count) {
if (symbol->option_2 == 9) { /* Version S */
strcpy(symbol->errtxt, "714: Structured Append not available for Version S");
return ZINT_ERROR_INVALID_OPTION;
}
if ((symbol->input_mode & 0x07) == GS1_MODE) {
strcpy(symbol->errtxt, "710: Cannot have Structured Append and GS1 mode at the same time");
return ZINT_ERROR_INVALID_OPTION;
@@ -997,15 +1001,11 @@ INTERNAL int code_one(struct zint_symbol *symbol, unsigned char source[], int le
unsigned int data[30], ecc[15];
int block_width;
if (symbol->structapp.count) { /* Version S */
strcpy(symbol->errtxt, "714: Structured Append not supported for Version S");
return ZINT_ERROR_INVALID_OPTION;
}
if (length > 18) {
strcpy(symbol->errtxt, "514: Input data too long for Version S");
return ZINT_ERROR_TOO_LONG;
}
if (is_sane(NEON, source, length) == ZINT_ERROR_INVALID_DATA) {
if (is_sane(NEON, source, length) != 0) {
strcpy(symbol->errtxt, "515: Invalid input data (Version S encodes numeric input only)");
return ZINT_ERROR_INVALID_DATA;
}