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

Unified Diff: xfa/src/fee/src/fee/fde_txtedtbuf.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/xml/fde_xml.cpp ('k') | xfa/src/fee/src/fee/fde_txtedtengine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fee/src/fee/fde_txtedtbuf.cpp
diff --git a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp b/xfa/src/fee/src/fee/fde_txtedtbuf.cpp
index 0019207212a0e7fb6d1960423e61428050e6648a..bdef8d2a9f0d7c18ad2fb19fb29471db947e6978 100644
--- a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp
+++ b/xfa/src/fee/src/fee/fde_txtedtbuf.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/fee/include/ifde_txtedtbuf.h"
#include "xfa/src/fee/include/ifde_txtedtengine.h"
@@ -269,7 +271,7 @@ void CFDE_TxtEdtBuf::Insert(int32_t nPos,
if (lpChunk->nUsed != m_nChunkSize) {
cp.nChunkIndex--;
int32_t nFree = m_nChunkSize - lpChunk->nUsed;
- int32_t nCopy = FX_MIN(nLengthTemp, nFree);
+ int32_t nCopy = std::min(nLengthTemp, nFree);
FXSYS_memcpy(lpChunk->wChars + lpChunk->nUsed, lpText,
nCopy * sizeof(FX_WCHAR));
lpText += nCopy;
@@ -282,7 +284,7 @@ void CFDE_TxtEdtBuf::Insert(int32_t nPos,
FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(
sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR));
FXSYS_assert(lpChunk);
- int32_t nCopy = FX_MIN(nLengthTemp, m_nChunkSize);
+ int32_t nCopy = std::min(nLengthTemp, m_nChunkSize);
FXSYS_memcpy(lpChunk->wChars, lpText, nCopy * sizeof(FX_WCHAR));
lpText += nCopy;
nLengthTemp -= nCopy;
@@ -302,7 +304,7 @@ void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength) {
int32_t nFirstPart = cpEnd.nCharIndex + 1;
int32_t nMovePart = lpChunk->nUsed - nFirstPart;
if (nMovePart != 0) {
- int32_t nDelete = FX_MIN(nFirstPart, nLength);
+ int32_t nDelete = std::min(nFirstPart, nLength);
FXSYS_memmove(lpChunk->wChars + nFirstPart - nDelete,
lpChunk->wChars + nFirstPart, nMovePart * sizeof(FX_WCHAR));
lpChunk->nUsed -= nDelete;
@@ -311,7 +313,7 @@ void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength) {
}
while (nLength > 0) {
lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cpEnd.nChunkIndex];
- int32_t nDeleted = FX_MIN(lpChunk->nUsed, nLength);
+ int32_t nDeleted = std::min(lpChunk->nUsed, nLength);
lpChunk->nUsed -= nDeleted;
if (lpChunk->nUsed == 0) {
m_pAllocator->Free(lpChunk);
« no previous file with comments | « xfa/src/fdp/src/xml/fde_xml.cpp ('k') | xfa/src/fee/src/fee/fde_txtedtengine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698