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

Unified Diff: xfa/src/fdp/src/tto/fde_textout.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/fdp/src/fde/fde_gedevice.cpp ('k') | xfa/src/fdp/src/xml/fde_xml.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fdp/src/tto/fde_textout.cpp
diff --git a/xfa/src/fdp/src/tto/fde_textout.cpp b/xfa/src/fdp/src/tto/fde_textout.cpp
index b9a8e80107ab107d5bd2f25003e44650f39578bb..90f21f15bb655f3b024c6841a02da9d1ea4aeeff 100644
--- a/xfa/src/fdp/src/tto/fde_textout.cpp
+++ b/xfa/src/fdp/src/tto/fde_textout.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "xfa/src/foxitlib.h"
#include "fde_textout.h"
IFDE_TextOut* IFDE_TextOut::Create() {
@@ -270,11 +272,11 @@ void CFDE_TextOut::CalcTextSize(const FX_WCHAR* pwsStr,
rect.top += fStartPos;
rect.left += fInc;
rect.width = fHeight;
- rect.height = FX_MIN(fWidth, rect.Height());
+ rect.height = std::min(fWidth, rect.Height());
} else {
rect.left += fStartPos;
rect.top += fInc;
- rect.width = FX_MIN(fWidth, rect.Width());
+ rect.width = std::min(fWidth, rect.Width());
rect.height = fHeight;
if (m_dwStyles & FDE_TTOSTYLE_LastLineHeight) {
rect.height -= m_fLineSpace - m_fFontSize;
@@ -313,7 +315,7 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(FX_DWORD dwBreakStatus,
for (int32_t i = 0; i < iCount; i++) {
const CFX_TxtPiece* pPiece = m_pTxtBreak->GetBreakPiece(i);
fLineWidth += (FX_FLOAT)pPiece->m_iWidth / 20000.0f;
- fStartPos = FX_MIN(fStartPos, (FX_FLOAT)pPiece->m_iStartPos / 20000.0f);
+ fStartPos = std::min(fStartPos, (FX_FLOAT)pPiece->m_iStartPos / 20000.0f);
}
m_pTxtBreak->ClearBreakPieces();
if (dwBreakStatus == FX_TXTBREAK_ParagraphBreak) {
@@ -322,7 +324,7 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(FX_DWORD dwBreakStatus,
if (!bLineWrap && dwBreakStatus == FX_TXTBREAK_LineBreak) {
fWidth += fLineWidth;
} else {
- fWidth = FX_MAX(fWidth, fLineWidth);
+ fWidth = std::max(fWidth, fLineWidth);
fHeight += fLineStep;
}
m_iTotalLines++;
« no previous file with comments | « xfa/src/fdp/src/fde/fde_gedevice.cpp ('k') | xfa/src/fdp/src/xml/fde_xml.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698