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

Side by Side Diff: xfa/src/fxbarcode/pdf417/BC_PDF417.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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 in part, and ZXing Authors in part 8 * Copyright 2006 Jeremias Maerki in part, and ZXing Authors in part
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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 int32_t rows = 545 int32_t rows =
546 calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols); 546 calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols);
547 if (rows < m_minRows) { 547 if (rows < m_minRows) {
548 break; 548 break;
549 } 549 }
550 if (rows > m_maxRows) { 550 if (rows > m_maxRows) {
551 continue; 551 continue;
552 } 552 }
553 FX_FLOAT newRatio = 553 FX_FLOAT newRatio =
554 ((17 * cols + 69) * DEFAULT_MODULE_WIDTH) / (rows * HEIGHT); 554 ((17 * cols + 69) * DEFAULT_MODULE_WIDTH) / (rows * HEIGHT);
555 if (dimension != NULL && 555 if (dimension &&
556 fabsf(newRatio - PREFERRED_RATIO) > fabsf(ratio - PREFERRED_RATIO)) { 556 fabsf(newRatio - PREFERRED_RATIO) > fabsf(ratio - PREFERRED_RATIO)) {
557 continue; 557 continue;
558 } 558 }
559 ratio = newRatio; 559 ratio = newRatio;
560 if (dimension) { 560 if (dimension) {
561 delete dimension; 561 delete dimension;
562 } 562 }
563 dimension = new CFX_Int32Array; 563 dimension = new CFX_Int32Array;
564 dimension->Add(cols); 564 dimension->Add(cols);
565 dimension->Add(rows); 565 dimension->Add(rows);
(...skipping 10 matching lines...) Expand all
576 dimension->Add(m_minCols); 576 dimension->Add(m_minCols);
577 dimension->Add(rows); 577 dimension->Add(rows);
578 } 578 }
579 } 579 }
580 if (dimension == NULL) { 580 if (dimension == NULL) {
581 e = BCExceptionUnableToFitMessageInColumns; 581 e = BCExceptionUnableToFitMessageInColumns;
582 return NULL; 582 return NULL;
583 } 583 }
584 return dimension; 584 return dimension;
585 } 585 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698