Fixes two virtual calls and one local variable reference. Closes issue 493 and issue...
authorflyashi <flyashi@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 6 Aug 2010 14:28:47 +0000 (14:28 +0000)
committerflyashi <flyashi@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 6 Aug 2010 14:28:47 +0000 (14:28 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1509 59b500cc-1b3d-0410-9834-0bbf25fbcc57

cpp/core/src/zxing/oned/UPCEANReader.h
cpp/core/src/zxing/oned/UPCEReader.cpp
cpp/core/src/zxing/oned/UPCEReader.h

index 3ffe4b2..5ce7ab0 100644 (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();
index 1fce8dd..fdea388 100644 (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;
                }
                
                
index 454d6ba..2a9e89a 100644 (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();
                };