OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2006 Jeremias Maerki. | 8 * Copyright 2006 Jeremias Maerki. |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 CFX_WideString sb; | 126 CFX_WideString sb; |
127 sb += codewords; | 127 sb += codewords; |
128 int32_t blockCount = symbolInfo->getInterleavedBlockCount(); | 128 int32_t blockCount = symbolInfo->getInterleavedBlockCount(); |
129 if (blockCount == 1) { | 129 if (blockCount == 1) { |
130 CFX_WideString ecc = | 130 CFX_WideString ecc = |
131 createECCBlock(codewords, symbolInfo->m_errorCodewords, e); | 131 createECCBlock(codewords, symbolInfo->m_errorCodewords, e); |
132 BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); | 132 BC_EXCEPTION_CHECK_ReturnValue(e, CFX_WideString()); |
133 sb += ecc; | 133 sb += ecc; |
134 } else { | 134 } else { |
135 CFX_Int32Array dataSizes; | 135 CFX_ArrayTemplate<int32_t> dataSizes; |
136 dataSizes.SetSize(blockCount); | 136 dataSizes.SetSize(blockCount); |
137 CFX_Int32Array errorSizes; | 137 CFX_ArrayTemplate<int32_t> errorSizes; |
138 errorSizes.SetSize(blockCount); | 138 errorSizes.SetSize(blockCount); |
139 CFX_Int32Array startPos; | 139 CFX_ArrayTemplate<int32_t> startPos; |
140 startPos.SetSize(blockCount); | 140 startPos.SetSize(blockCount); |
141 for (int32_t i = 0; i < blockCount; i++) { | 141 for (int32_t i = 0; i < blockCount; i++) { |
142 dataSizes[i] = symbolInfo->getDataLengthForInterleavedBlock(i + 1); | 142 dataSizes[i] = symbolInfo->getDataLengthForInterleavedBlock(i + 1); |
143 errorSizes[i] = symbolInfo->getErrorLengthForInterleavedBlock(i + 1); | 143 errorSizes[i] = symbolInfo->getErrorLengthForInterleavedBlock(i + 1); |
144 startPos[i] = 0; | 144 startPos[i] = 0; |
145 if (i > 0) { | 145 if (i > 0) { |
146 startPos[i] = startPos[i - 1] + dataSizes[i]; | 146 startPos[i] = startPos[i - 1] + dataSizes[i]; |
147 } | 147 } |
148 } | 148 } |
149 for (int32_t block = 0; block < blockCount; block++) { | 149 for (int32_t block = 0; block < blockCount; block++) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 ecc[0] = 0; | 199 ecc[0] = 0; |
200 } | 200 } |
201 } | 201 } |
202 CFX_WideString strecc; | 202 CFX_WideString strecc; |
203 for (int32_t j = 0; j < numECWords; j++) { | 203 for (int32_t j = 0; j < numECWords; j++) { |
204 strecc += (FX_WCHAR)ecc[numECWords - j - 1]; | 204 strecc += (FX_WCHAR)ecc[numECWords - j - 1]; |
205 } | 205 } |
206 FX_Free(ecc); | 206 FX_Free(ecc); |
207 return strecc; | 207 return strecc; |
208 } | 208 } |
OLD | NEW |