Fixes two virtual calls and one local variable reference. Closes issue 493 and issue 498 and makes UPC-E work.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1509 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
flyashi 2010-08-06 14:28:47 +00:00
parent 2cb4f5f82b
commit 2de913d220
3 changed files with 5 additions and 6 deletions

View file

@ -39,7 +39,7 @@ namespace zxing {
static int* findStartGuardPattern(Ref<BitArray> row); //throws ReaderException
int* decodeEnd(Ref<BitArray> row, int endStart); //throws ReaderException
virtual int* decodeEnd(Ref<BitArray> row, int endStart); //throws ReaderException
static bool checkStandardUPCEANChecksum(std::string s); //throws ReaderException
protected:
@ -58,7 +58,7 @@ namespace zxing {
static int decodeDigit(Ref<BitArray> row, int counters[], int countersLen, int rowOffset, UPC_EAN_PATTERNS patternType); //throws ReaderException
bool checkChecksum(std::string s); //throws ReaderException
virtual bool checkChecksum(std::string s); //throws ReaderException
virtual BarcodeFormat getBarcodeFormat() = 0;
virtual ~UPCEANReader();

View file

@ -95,7 +95,7 @@ namespace zxing {
* @param upce UPC-E code as string of digits
* @return equivalent UPC-A code as string of digits
*/
std::string& UPCEReader::convertUPCEtoUPCA(std::string upce) {
std::string UPCEReader::convertUPCEtoUPCA(std::string upce) {
std::string result;
result.append(1, upce[0]);
char lastChar = upce[6];
@ -125,8 +125,7 @@ namespace zxing {
break;
}
result.append(1, upce[7]);
std::string& returnResult = result;
return returnResult;
return result;
}

View file

@ -37,7 +37,7 @@ namespace zxing {
UPCEReader();
int decodeMiddle(Ref<BitArray> row, int startRange[], int startRangeLen, std::string& resultString); //throws ReaderException
static std::string& convertUPCEtoUPCA(std::string upce);
static std::string convertUPCEtoUPCA(std::string upce);
BarcodeFormat getBarcodeFormat();
};