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

Unified Diff: xfa/src/fgas/src/layout/fx_rtfbreak.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/fgas/src/crt/fx_utils.cpp ('k') | xfa/src/fgas/src/layout/fx_textbreak.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fgas/src/layout/fx_rtfbreak.cpp
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
index 8683bcfdb6361aa63c944c50ae9f531557e233c3..26d27312bc1656e16739b3efd2968b16248a3b0d 100644
--- a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
+++ b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "xfa/src/fgas/include/fx_lbk.h"
#include "xfa/src/fgas/src/fgas_base.h"
#include "xfa/src/fgas/src/layout/fx_unicode.h"
@@ -389,7 +391,7 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) {
(this->*g_FX_RTFBreak_lpfAppendChar[dwType >> FX_CHARTYPEBITS])(
pCurChar, iRotation);
m_dwCharType = dwType;
- return FX_MAX(dwRet1, dwRet2);
+ return std::max(dwRet1, dwRet2);
}
FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) {
FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL);
@@ -1151,7 +1153,7 @@ void CFX_RTFBreak::GetLineRect(CFX_RectF& rect) const {
pBreakPiece = rtfPieces.GetPtrAt(i);
int32_t iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight *
pBreakPiece->m_iVerticalScale / 100.0f);
- iMax = FX_MAX(pBreakPiece->m_iFontSize, iFontHeight);
+ iMax = std::max(pBreakPiece->m_iFontSize, iFontHeight);
if (i == 0) {
iLineHeight = iMax;
} else if (iLineHeight < iMax) {
@@ -1441,7 +1443,7 @@ int32_t CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText,
if (bCharBBox) {
bCharBBox = pFont->GetBBox(bbox);
}
- FX_FLOAT fLeft = FX_MAX(0, bbox.left * fScale);
+ FX_FLOAT fLeft = std::max(0.0f, bbox.left * fScale);
FX_FLOAT fHeight = FXSYS_fabs(bbox.height * fScale);
rtArray.RemoveAll();
rtArray.SetSize(iLength);
@@ -1506,13 +1508,13 @@ int32_t CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText,
rtBBoxF.left = rect.top + (rect.height - fHeight) / 2.0f;
rtBBoxF.height = fCharWidth;
rtBBoxF.width = fHeight;
- rtBBoxF.left = FX_MAX(rtBBoxF.left, 0);
+ rtBBoxF.left = std::max(rtBBoxF.left, 0.0f);
} else {
rtBBoxF.left = rect.left + fRTLeft;
rtBBoxF.top = rect.top + (rect.height - fHeight) / 2.0f;
rtBBoxF.width = fCharWidth;
rtBBoxF.height = fHeight;
- rtBBoxF.top = FX_MAX(rtBBoxF.top, 0);
+ rtBBoxF.top = std::max(rtBBoxF.top, 0.0f);
}
rtArray.SetAt(i, rtBBoxF);
continue;
« no previous file with comments | « xfa/src/fgas/src/crt/fx_utils.cpp ('k') | xfa/src/fgas/src/layout/fx_textbreak.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698