diff --git a/source/zxing/zxing/qrcode/decoder/Mode.h b/source/zxing/zxing/qrcode/decoder/Mode.h index 65c99a4..93f1556 100644 --- a/source/zxing/zxing/qrcode/decoder/Mode.h +++ b/source/zxing/zxing/qrcode/decoder/Mode.h @@ -34,8 +34,8 @@ private: int characterCountBitsForVersions0To9_; int characterCountBitsForVersions10To26_; int characterCountBitsForVersions27AndHigher_; - std::string name_; int bits_; + std::string name_; Mode(int cbv0_9, int cbv10_26, int cbv27, int bits, char const* name); @@ -54,7 +54,7 @@ public: static Mode HANZI; static Mode& forBits(int bits); - int getCharacterCountBits(Version *version); + int getCharacterCountBits(const Version *version) const; int getBits() const { return bits_; } bool operator==(const Mode& other); diff --git a/source/zxing/zxing/qrcode/decoder/QRMode.cpp b/source/zxing/zxing/qrcode/decoder/QRMode.cpp index 0e223db..5ba2ce3 100644 --- a/source/zxing/zxing/qrcode/decoder/QRMode.cpp +++ b/source/zxing/zxing/qrcode/decoder/QRMode.cpp @@ -54,6 +54,7 @@ Mode::Mode(const zxing::qrcode::Mode &mode) characterCountBitsForVersions0To9_ = mode.characterCountBitsForVersions0To9_; characterCountBitsForVersions10To26_ = mode.characterCountBitsForVersions10To26_; characterCountBitsForVersions27AndHigher_ = mode.characterCountBitsForVersions27AndHigher_; + bits_ = mode.bits_; name_ = mode.name_; } @@ -87,7 +88,7 @@ Mode& Mode::forBits(int bits) { } } -int Mode::getCharacterCountBits(Version *version) +int Mode::getCharacterCountBits(const Version *version) const { int number = version->getVersionNumber(); if (number <= 9) {