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

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

Issue 1927253002: Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, Part 5 (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_QRAlignmentPatternFinder.h ('k') | xfa/fxbarcode/qrcode/BC_QRFinderPattern.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp
diff --git a/xfa/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp b/xfa/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp
index 8c462bf3284d8d95106c68ab2883b45768f4ae8f..75565ca64130d86d897f6d0249ce5f7238f46164 100644
--- a/xfa/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp
@@ -40,12 +40,12 @@ CBC_QRAlignmentPatternFinder::CBC_QRAlignmentPatternFinder(
m_moduleSize(moduleSize) {
m_crossCheckStateCount.SetSize(3);
}
+
CBC_QRAlignmentPatternFinder::~CBC_QRAlignmentPatternFinder() {
- for (int32_t i = 0; i < m_possibleCenters.GetSize(); i++) {
- delete (CBC_QRAlignmentPattern*)m_possibleCenters[i];
- }
- m_possibleCenters.RemoveAll();
+ for (int32_t i = 0; i < m_possibleCenters.GetSize(); i++)
+ delete m_possibleCenters[i];
}
+
CBC_QRAlignmentPattern* CBC_QRAlignmentPatternFinder::Find(int32_t& e) {
int32_t startX = m_startX;
int32_t height = m_height;
@@ -102,7 +102,7 @@ CBC_QRAlignmentPattern* CBC_QRAlignmentPatternFinder::Find(int32_t& e) {
}
}
if (m_possibleCenters.GetSize() != 0) {
- return ((CBC_QRAlignmentPattern*)(m_possibleCenters[0]))->Clone();
+ return m_possibleCenters[0]->Clone();
}
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
@@ -186,8 +186,7 @@ CBC_QRAlignmentPattern* CBC_QRAlignmentPatternFinder::HandlePossibleCenter(
(FX_FLOAT)(stateCount[0] + stateCount[1] + stateCount[2]) / 3.0f;
int32_t max = m_possibleCenters.GetSize();
for (int32_t index = 0; index < max; index++) {
- CBC_QRAlignmentPattern* center =
- (CBC_QRAlignmentPattern*)(m_possibleCenters[index]);
+ CBC_QRAlignmentPattern* center = m_possibleCenters[index];
if (center->AboutEquals(estimatedModuleSize, centerI, centerJ)) {
return new CBC_QRAlignmentPattern(centerJ, centerI,
estimatedModuleSize);
« no previous file with comments | « xfa/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h ('k') | xfa/fxbarcode/qrcode/BC_QRFinderPattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698