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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_editimp.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/fwl/src/basewidget/fwl_checkboximp.cpp ('k') | xfa/src/fwl/src/core/fwl_widgetimp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fwl/src/basewidget/fwl_editimp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp
index 9b652a79fc315a2c59890ca463fbdf629ecfad3f..06e185e5a2fe2e4617227bd6ab985f84697174fe 100644
--- a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "xfa/src/foxitlib.h"
#include "xfa/src/fwl/src/core/include/fwl_threadimp.h"
#include "xfa/src/fwl/src/core/include/fwl_appimp.h"
@@ -887,11 +889,11 @@ void CFWL_EditImp::On_TextChanged(IFDE_TxtEdtEngine* pEdit,
fContentHeight1 = page1->GetContentsBox().height;
}
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_HSelfAdaption) {
- rtTemp.width = FX_MAX(m_pProperties->m_rtWidget.width, fContentWidth1);
+ rtTemp.width = std::max(m_pProperties->m_rtWidget.width, fContentWidth1);
m_pProperties->m_rtWidget.width = fContentWidth1;
}
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_VSelfAdaption) {
- rtTemp.height = FX_MAX(m_pProperties->m_rtWidget.height, fContentHeight1);
+ rtTemp.height = std::max(m_pProperties->m_rtWidget.height, fContentHeight1);
m_pProperties->m_rtWidget.height = fContentHeight1;
}
CFWL_EvtEdtTextChanged event;
@@ -1062,8 +1064,8 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics,
if (nCharEnd < nPageCharStart || nCharStart > nPageCharEnd) {
continue;
}
- int32_t nBgn = FX_MAX(nCharStart, nPageCharStart);
- int32_t nEnd = FX_MIN(nCharEnd, nPageCharEnd);
+ int32_t nBgn = std::max(nCharStart, nPageCharStart);
+ int32_t nEnd = std::min(nCharEnd, nPageCharEnd);
pPage->CalcRangeRectArray(nBgn - nPageCharStart, nEnd - nBgn + 1,
rectArr);
}
@@ -1926,8 +1928,8 @@ void CFWL_EditImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) {
}
FX_BOOL bShift = pMsg->m_dwFlags & FWL_KEYFLAG_Shift;
if (bShift && m_pOwner->m_nSelStart != nIndex) {
- int32_t iStart = FX_MIN(m_pOwner->m_nSelStart, nIndex);
- int32_t iEnd = FX_MAX(m_pOwner->m_nSelStart, nIndex);
+ int32_t iStart = std::min(m_pOwner->m_nSelStart, nIndex);
+ int32_t iEnd = std::max(m_pOwner->m_nSelStart, nIndex);
m_pOwner->m_pEdtEngine->AddSelRange(iStart, iEnd - iStart);
bRepaint = TRUE;
} else {
@@ -1985,7 +1987,7 @@ void CFWL_EditImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) {
m_pOwner->m_nSelStart = nLen;
}
m_pOwner->m_pEdtEngine->AddSelRange(
- FX_MIN(m_pOwner->m_nSelStart, nIndex),
+ std::min(m_pOwner->m_nSelStart, nIndex),
FXSYS_abs(nIndex - m_pOwner->m_nSelStart));
}
}
« no previous file with comments | « xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp ('k') | xfa/src/fwl/src/core/fwl_widgetimp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698