Issue 911 update Code 128 from Java to fix some issues

git-svn-id: https://zxing.googlecode.com/svn/trunk@1858 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-07-14 18:32:23 +00:00
parent 2cbef6043b
commit de125e2ddc

View file

@ -376,11 +376,14 @@ namespace zxing {
} }
break; break;
case CODE_CODE_C: case CODE_CODE_C:
// the code read in this case is the number encoded directly tmpResultSStr.str(std::string());
// the code read in this case is the number encoded directly
if (code < 100) { if (code < 100) {
if (code < 10) if (code < 10) {
tmpResultSStr << '0'; tmpResultSStr << '0';
tmpResultSStr << code; }
tmpResultSStr << code;
tmpResultString.append(tmpResultSStr.str());
} else { } else {
if (code != CODE_STOP) { if (code != CODE_STOP) {
lastCharacterWasPrintable = false; lastCharacterWasPrintable = false;
@ -438,9 +441,6 @@ namespace zxing {
throw ReaderException(""); throw ReaderException("");
} }
if (codeSet == CODE_CODE_C)
tmpResultString.append(tmpResultSStr.str());
// Need to pull out the check digits from string // Need to pull out the check digits from string
int resultLength = tmpResultString.length(); int resultLength = tmpResultString.length();
// Only bother if the result had at least one character, and if the checksum digit happened to // Only bother if the result had at least one character, and if the checksum digit happened to