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

Unified Diff: xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp

Issue 1941863002: Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, part 11 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits. 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/qrcode/BC_QRCoderVersion.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp
index e92267819c98538889af094e9a6377d936fbc89f..9c3a1cc138c1bf2fadfc1c2f79676189da0647b1 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderVersion.cpp
@@ -35,17 +35,18 @@ const int32_t CBC_QRCoderVersion::VERSION_DECODE_INFO[] = {
0x15683, 0x168C9, 0x177EC, 0x18EC4, 0x191E1, 0x1AFAB, 0x1B08E,
0x1CC1A, 0x1D33F, 0x1ED75, 0x1F250, 0x209D5, 0x216F0, 0x228BA,
0x2379F, 0x24B0B, 0x2542E, 0x26A64, 0x27541, 0x28C69};
-CFX_PtrArray* CBC_QRCoderVersion::VERSION = NULL;
+
+CFX_ArrayTemplate<CBC_QRCoderVersion*>* CBC_QRCoderVersion::VERSION = nullptr;
void CBC_QRCoderVersion::Initialize() {
- VERSION = new CFX_PtrArray();
+ VERSION = new CFX_ArrayTemplate<CBC_QRCoderVersion*>();
}
void CBC_QRCoderVersion::Finalize() {
- for (int32_t i = 0; i < VERSION->GetSize(); i++) {
- CBC_QRCoderVersion* v = (CBC_QRCoderVersion*)(VERSION->GetAt(i));
- delete v;
- }
+ for (int32_t i = 0; i < VERSION->GetSize(); i++)
+ delete VERSION->GetAt(i);
+
delete VERSION;
+ VERSION = nullptr;
}
CBC_QRCoderVersion::CBC_QRCoderVersion(int32_t versionNumber,
CBC_QRCoderECBlocks* ecBlocks1,
@@ -755,11 +756,11 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(
e = BCExceptionIllegalArgument;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- return (CBC_QRCoderVersion*)(*VERSION)[versionNumber - 1];
+ return (*VERSION)[versionNumber - 1];
}
+
void CBC_QRCoderVersion::Destroy() {
- int32_t i;
- for (i = 0; i < VERSION->GetSize(); i++) {
- delete ((CBC_QRCoderVersion*)(*VERSION)[i]);
- }
+ for (int32_t i = 0; i < VERSION->GetSize(); i++)
+ delete (*VERSION)[i];
+ VERSION->RemoveAll();
}
« no previous file with comments | « xfa/fxbarcode/qrcode/BC_QRCoderVersion.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698