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

Unified Diff: core/src/fxcrt/fx_basic_wstring.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 | « core/src/fxcrt/fx_basic_buffer.cpp ('k') | core/src/fxcrt/fx_extension.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_wstring.cpp
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index dd26f595f2b320024f36d05d872456c1ce9d01e7..2370c87cf18a450d419df7be4ce148bb964d1205 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -5,6 +5,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include <stddef.h> // For offsetof().
+
+#include <algorithm>
#include <cctype>
#include "core/include/fxcrt/fx_basic.h"
@@ -639,7 +641,7 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld,
pOldData->Release();
}
lpszStart = m_pData->m_String;
- lpszEnd = m_pData->m_String + FX_MAX(m_pData->m_nDataLength, nNewLength);
+ lpszEnd = m_pData->m_String + std::max(m_pData->m_nDataLength, nNewLength);
{
while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) !=
NULL &&
@@ -758,9 +760,7 @@ void CFX_WideString::FormatV(const FX_WCHAR* lpszFormat, va_list argList) {
nMaxLen += 2;
} else if (*lpsz == '*') {
nWidth = va_arg(argList, int);
- } else if (*lpsz == '-' || *lpsz == '+' || *lpsz == '0' || *lpsz == ' ')
- ;
- else {
+ } else if (*lpsz != '-' && *lpsz != '+' && *lpsz != '0' && *lpsz != ' ') {
break;
}
}
« no previous file with comments | « core/src/fxcrt/fx_basic_buffer.cpp ('k') | core/src/fxcrt/fx_extension.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698