diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fxbarcode/datamatrix/BC_ErrorCorrection.cpp | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz |
Convert string class names
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxbarcode/datamatrix/BC_ErrorCorrection.cpp')
-rw-r--r-- | fxbarcode/datamatrix/BC_ErrorCorrection.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index c45eadcf9a..35077ee628 100644 --- a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -119,22 +119,21 @@ void CBC_ErrorCorrection::Initialize() { void CBC_ErrorCorrection::Finalize() {} CBC_ErrorCorrection::CBC_ErrorCorrection() {} CBC_ErrorCorrection::~CBC_ErrorCorrection() {} -CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, - CBC_SymbolInfo* symbolInfo, - int32_t& e) { +WideString CBC_ErrorCorrection::encodeECC200(WideString codewords, + CBC_SymbolInfo* symbolInfo, + int32_t& e) { if (pdfium::base::checked_cast<int32_t>(codewords.GetLength()) != symbolInfo->dataCapacity()) { e = BCExceptionIllegalArgument; - return CFX_WideString(); + return WideString(); } - CFX_WideString sb; + WideString sb; sb += codewords; int32_t blockCount = symbolInfo->getInterleavedBlockCount(); if (blockCount == 1) { - CFX_WideString ecc = - createECCBlock(codewords, symbolInfo->errorCodewords(), e); + WideString ecc = createECCBlock(codewords, symbolInfo->errorCodewords(), e); if (e != BCExceptionNO) - return CFX_WideString(); + return WideString(); sb += ecc; } else { std::vector<int32_t> dataSizes(blockCount); @@ -149,13 +148,13 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, } } for (int32_t block = 0; block < blockCount; block++) { - CFX_WideString temp; + WideString temp; for (int32_t d = block; d < symbolInfo->dataCapacity(); d += blockCount) { temp += (wchar_t)codewords[d]; } - CFX_WideString ecc = createECCBlock(temp, errorSizes[block], e); + WideString ecc = createECCBlock(temp, errorSizes[block], e); if (e != BCExceptionNO) - return CFX_WideString(); + return WideString(); int32_t pos = 0; for (int32_t l = block; l < errorSizes[block] * blockCount; l += blockCount) { @@ -165,16 +164,16 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, } return sb; } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, - int32_t numECWords, - int32_t& e) { +WideString CBC_ErrorCorrection::createECCBlock(WideString codewords, + int32_t numECWords, + int32_t& e) { return createECCBlock(codewords, 0, codewords.GetLength(), numECWords, e); } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, - int32_t start, - int32_t len, - int32_t numECWords, - int32_t& e) { +WideString CBC_ErrorCorrection::createECCBlock(WideString codewords, + int32_t start, + int32_t len, + int32_t numECWords, + int32_t& e) { static const size_t kFactorTableNum = sizeof(FACTOR_SETS) / sizeof(int32_t); size_t table = 0; while (table < kFactorTableNum && FACTOR_SETS[table] != numECWords) @@ -182,7 +181,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, if (table >= kFactorTableNum) { e = BCExceptionIllegalArgument; - return CFX_WideString(); + return WideString(); } uint16_t* ecc = FX_Alloc(uint16_t, numECWords); memset(ecc, 0, numECWords * sizeof(uint16_t)); @@ -202,7 +201,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, ecc[0] = 0; } } - CFX_WideString strecc; + WideString strecc; for (int32_t j = 0; j < numECWords; j++) { strecc += (wchar_t)ecc[numECWords - j - 1]; } |