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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp

Issue 1577503002: Merge to XFA: Switch most min/max macros to std::min/max. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 4 years, 11 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/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp ('k') | xfa/src/fxfa/src/app/xfa_ffapp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
index 1b799114b42af9ee677944f5c7478d6f23264f57..2280e9a4b87744e2e112fb0a0431f16c29dca87e 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <algorithm>
+
#include "xfa/src/fxbarcode/barcode.h"
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/BC_ResultPoint.h"
@@ -255,16 +257,16 @@ CBC_QRAlignmentPattern* CBC_QRDetector::FindAlignmentInRegion(
FX_FLOAT allowanceFactor,
int32_t& e) {
int32_t allowance = (int32_t)(allowanceFactor * overallEstModuleSize);
- int32_t alignmentAreaLeftX = FX_MAX(0, estAlignmentX - allowance);
+ int32_t alignmentAreaLeftX = std::max(0, estAlignmentX - allowance);
int32_t alignmentAreaRightX =
- FX_MIN(m_image->GetWidth() - 1, estAlignmentX + allowance);
+ std::min(m_image->GetWidth() - 1, estAlignmentX + allowance);
if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) {
e = BCExceptionRead;
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
}
- int32_t alignmentAreaTopY = FX_MAX(0, estAlignmentY - allowance);
+ int32_t alignmentAreaTopY = std::max(0, estAlignmentY - allowance);
int32_t alignmentAreaBottomY =
- FX_MIN(m_image->GetHeight() - 1, estAlignmentY + allowance);
+ std::min(m_image->GetHeight() - 1, estAlignmentY + allowance);
CBC_QRAlignmentPatternFinder alignmentFinder(
m_image, alignmentAreaLeftX, alignmentAreaTopY,
alignmentAreaRightX - alignmentAreaLeftX,
« no previous file with comments | « xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp ('k') | xfa/src/fxfa/src/app/xfa_ffapp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698