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 2007 ZXing authors | 8 * Copyright 2007 ZXing authors |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int32_t total = 0; | 52 int32_t total = 0; |
53 int32_t ecCodewords = ecBlocks->GetECCodewords(); | 53 int32_t ecCodewords = ecBlocks->GetECCodewords(); |
54 const CFX_PtrArray& ecbArray = ecBlocks->GetECBlocks(); | 54 const CFX_PtrArray& ecbArray = ecBlocks->GetECBlocks(); |
55 for (int32_t i = 0; i < ecbArray.GetSize(); i++) { | 55 for (int32_t i = 0; i < ecbArray.GetSize(); i++) { |
56 total += ((ECB*)ecbArray[i])->GetCount() * | 56 total += ((ECB*)ecbArray[i])->GetCount() * |
57 (((ECB*)ecbArray[i])->GetDataCodewords() + ecCodewords); | 57 (((ECB*)ecbArray[i])->GetDataCodewords() + ecCodewords); |
58 } | 58 } |
59 m_totalCodewords = total; | 59 m_totalCodewords = total; |
60 } | 60 } |
61 CBC_DataMatrixVersion::~CBC_DataMatrixVersion() { | 61 CBC_DataMatrixVersion::~CBC_DataMatrixVersion() { |
62 if (m_ecBlocks != NULL) { | 62 delete m_ecBlocks; |
63 delete m_ecBlocks; | |
64 } | |
65 m_ecBlocks = NULL; | |
66 } | 63 } |
67 int32_t CBC_DataMatrixVersion::GetVersionNumber() { | 64 int32_t CBC_DataMatrixVersion::GetVersionNumber() { |
68 return m_versionNumber; | 65 return m_versionNumber; |
69 } | 66 } |
70 int32_t CBC_DataMatrixVersion::GetSymbolSizeRows() { | 67 int32_t CBC_DataMatrixVersion::GetSymbolSizeRows() { |
71 return m_symbolSizeRows; | 68 return m_symbolSizeRows; |
72 } | 69 } |
73 int32_t CBC_DataMatrixVersion::GetSymbolSizeColumns() { | 70 int32_t CBC_DataMatrixVersion::GetSymbolSizeColumns() { |
74 return m_symbolSizeColumns; | 71 return m_symbolSizeColumns; |
75 } | 72 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 if (((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeRows == | 164 if (((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeRows == |
168 numRows && | 165 numRows && |
169 ((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeColumns == | 166 ((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeColumns == |
170 numColumns) { | 167 numColumns) { |
171 return (CBC_DataMatrixVersion*)(*VERSIONS)[i]; | 168 return (CBC_DataMatrixVersion*)(*VERSIONS)[i]; |
172 } | 169 } |
173 } | 170 } |
174 e = BCExceptionNotFound; | 171 e = BCExceptionNotFound; |
175 return NULL; | 172 return NULL; |
176 } | 173 } |
OLD | NEW |