Don't display warning 222 in GUI

This commit is contained in:
Robin Stuart 2018-01-21 14:59:15 +00:00
parent d2161ffb20
commit baf56daa17

View File

@ -81,8 +81,7 @@ namespace Zint {
QByteArray bstr = m_text.toUtf8();
QByteArray pstr = m_primaryMessage.left(99).toLatin1();
strcpy(m_zintSymbol->primary, pstr.data());
int error = ZBarcode_Encode(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length());
if (error > ZINT_WARN_INVALID_OPTION)
m_error = ZBarcode_Encode(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length());
m_lastError = m_zintSymbol->errtxt;
if (m_zintSymbol->symbology == BARCODE_MAXICODE)
@ -317,7 +316,8 @@ namespace Zint {
QFont fontLarge(fontstyle);
fontLarge.setPixelSize(fontPixelSizeLarge);
if (m_lastError.length()) {
if (m_error >= 5) {
// Display error message instead of barcode
fontLarge.setPointSize(14);
painter.setFont(fontLarge);
painter.drawText(paintRect, Qt::AlignCenter, m_lastError);