diff options
author | Lei Zhang <thestig@chromium.org> | 2016-01-11 11:59:17 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-01-11 11:59:17 -0800 |
commit | 375a86403b7fa8d17d7b142c270e2d8e33bb924f (patch) | |
tree | 1db1ffddb2bbbcd429cd1d7954b1949bfa54e1ab /core/src/fxcrt/fx_basic_wstring.cpp | |
parent | 492961df3011ccc25646eae12ac6e6dcfe7f26da (diff) | |
download | pdfium-375a86403b7fa8d17d7b142c270e2d8e33bb924f.tar.xz |
Merge to XFA: Switch most min/max macros to std::min/max.
Fix lint errors along the way.
R=tsepez@chromium.org
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1567343002 .
(cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a)
Review URL: https://codereview.chromium.org/1577503002 .
Diffstat (limited to 'core/src/fxcrt/fx_basic_wstring.cpp')
-rw-r--r-- | core/src/fxcrt/fx_basic_wstring.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index dd26f595f2..2370c87cf1 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; } } |