Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp

Issue 1937513002: Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, part 8 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Flip if/else. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h ('k') | xfa/fxbarcode/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
index e441a29e441a0c4def3780ce64d9f67b680ff73a..d1dcc23e7ba6523ce8edefd4413bdbd561a6f9d5 100644
--- a/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp
@@ -25,14 +25,15 @@
#include "xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h"
#include "xfa/fxbarcode/utils.h"
-CFX_PtrArray* CBC_DataMatrixVersion::VERSIONS = NULL;
+CFX_ArrayTemplate<CBC_DataMatrixVersion*>* CBC_DataMatrixVersion::VERSIONS =
+ nullptr;
void CBC_DataMatrixVersion::Initialize() {
- VERSIONS = new CFX_PtrArray();
+ VERSIONS = new CFX_ArrayTemplate<CBC_DataMatrixVersion*>();
}
void CBC_DataMatrixVersion::Finalize() {
for (int32_t i = 0; i < VERSIONS->GetSize(); i++) {
- delete ((CBC_DataMatrixVersion*)(VERSIONS->GetAt(i)));
+ delete VERSIONS->GetAt(i);
}
VERSIONS->RemoveAll();
delete VERSIONS;
@@ -84,7 +85,7 @@ ECBlocks* CBC_DataMatrixVersion::GetECBlocks() {
}
void CBC_DataMatrixVersion::ReleaseAll() {
for (int32_t i = 0; i < VERSIONS->GetSize(); i++) {
- delete (CBC_DataMatrixVersion*)VERSIONS->GetAt(i);
+ delete VERSIONS->GetAt(i);
}
VERSIONS->RemoveAll();
}
@@ -94,7 +95,7 @@ CBC_DataMatrixVersion* CBC_DataMatrixVersion::GetVersionForDimensions(
int32_t& e) {
if ((numRows & 0x01) != 0 || (numColumns & 0x01) != 0) {
e = BCExceptionNotFound;
- return NULL;
+ return nullptr;
}
if (VERSIONS->GetSize() == 0) {
VERSIONS->Add(new CBC_DataMatrixVersion(1, 10, 10, 8, 8,
@@ -161,13 +162,11 @@ CBC_DataMatrixVersion* CBC_DataMatrixVersion::GetVersionForDimensions(
}
int32_t numVersions = VERSIONS->GetSize();
for (int32_t i = 0; i < numVersions; ++i) {
- if (((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeRows ==
- numRows &&
- ((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeColumns ==
- numColumns) {
- return (CBC_DataMatrixVersion*)(*VERSIONS)[i];
+ if ((*VERSIONS)[i]->m_symbolSizeRows == numRows &&
+ (*VERSIONS)[i]->m_symbolSizeColumns == numColumns) {
+ return (*VERSIONS)[i];
}
}
e = BCExceptionNotFound;
- return NULL;
+ return nullptr;
}
« no previous file with comments | « xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h ('k') | xfa/fxbarcode/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698