Remove DMatrix option bug in UI

Do not change value of option3 if user has selected a Data Matrix symbol size.
If a warning is generated when saving, make this visible to user.
Fixes #85 reported by Harald Oehlmann
This commit is contained in:
Robin Stuart 2017-12-19 22:01:45 +00:00
parent 9f50714b44
commit c55340f4f3
3 changed files with 33 additions and 14 deletions

View file

@ -220,6 +220,10 @@ namespace Zint {
void QZint::setSecurityLevel(int securityLevel) {
m_securityLevel = securityLevel;
}
int QZint::getError() {
return m_error;
}
QString QZint::error_message() const {
return m_lastError;
@ -275,14 +279,12 @@ namespace Zint {
QByteArray bgcol = bg_colour_hash.right(6).toLatin1();
strcpy(m_zintSymbol->fgcolour, fgcol.data());
strcpy(m_zintSymbol->bgcolour, bgcol.data());
int error = ZBarcode_Encode_and_Print(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length(), 0);
if (error > ZINT_WARN_INVALID_OPTION) {
m_error = ZBarcode_Encode_and_Print(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length(), 0);
if (m_error != 0) {
m_lastError = m_zintSymbol->errtxt;
}
if (error == 0) {
return true;
} else {
return false;
} else {
return true;
}
}