summaryrefslogtreecommitdiff
path: root/xfa/src/fee
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fee')
-rw-r--r--xfa/src/fee/src/fee/fde_txtedtbuf.cpp10
-rw-r--r--xfa/src/fee/src/fee/fde_txtedtengine.cpp6
-rw-r--r--xfa/src/fee/src/fee/fde_txtedtpage.cpp6
3 files changed, 14 insertions, 8 deletions
diff --git a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp b/xfa/src/fee/src/fee/fde_txtedtbuf.cpp
index 0019207212..bdef8d2a9f 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);
diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.cpp b/xfa/src/fee/src/fee/fde_txtedtengine.cpp
index 51f41d1273..7d87f2c0e9 100644
--- a/xfa/src/fee/src/fee/fde_txtedtengine.cpp
+++ b/xfa/src/fee/src/fee/fde_txtedtengine.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_txtedtengine.h"
#include "xfa/src/fee/include/ifde_txtedtbuf.h"
@@ -122,7 +124,7 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream* pStream) {
uint8_t bom[4];
int32_t nPos = pStream->GetBOM(bom);
pStream->Seek(FX_STREAMSEEK_Begin, nPos);
- int32_t nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize());
+ int32_t nPlateSize = std::min(nStreamLength, m_pTxtBuf->GetChunkSize());
FX_WCHAR* lpwstr = FX_Alloc(FX_WCHAR, nPlateSize);
FX_BOOL bEos = false;
while (!bEos) {
@@ -389,7 +391,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
break;
}
if (bShift && m_nAnchorPos != -1 && (m_nAnchorPos != m_nCaret)) {
- AddSelRange(FX_MIN(m_nAnchorPos, m_nCaret),
+ AddSelRange(std::min(m_nAnchorPos, m_nCaret),
FXSYS_abs(m_nAnchorPos - m_nCaret));
m_Param.pEventSink->On_SelChanged(this);
}
diff --git a/xfa/src/fee/src/fee/fde_txtedtpage.cpp b/xfa/src/fee/src/fee/fde_txtedtpage.cpp
index 2c592232f6..fbeccbeba0 100644
--- a/xfa/src/fee/src/fee/fde_txtedtpage.cpp
+++ b/xfa/src/fee/src/fee/fde_txtedtpage.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"
@@ -395,8 +397,8 @@ int32_t CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox, IFX_Pause* pPause) {
pBreak->ClearBreakPieces();
int32_t nPageLineCount = m_pEditEngine->GetPageLineCount();
int32_t nStartLine = nPageLineCount * m_nPageIndex;
- int32_t nEndLine = FX_MIN((nStartLine + nPageLineCount - 1),
- (m_pEditEngine->GetLineCount() - 1));
+ int32_t nEndLine = std::min((nStartLine + nPageLineCount - 1),
+ (m_pEditEngine->GetLineCount() - 1));
int32_t nPageStart, nPageEnd, nTemp, nBgnParag, nStartLineInParag, nEndParag,
nEndLineInParag;
nBgnParag = m_pEditEngine->Line2Parag(0, 0, nStartLine, nStartLineInParag);