summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtengine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-15 09:43:07 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-15 15:00:00 +0000
commit171cb27a720036c48ae3a6176084e880742af0a9 (patch)
tree8f4d2f9b2db6cc233b835d1ef24f7d71c723f05c /xfa/fde/cfde_txtedtengine.cpp
parent73b492a5d775c05d8c186c8478d1003edfffd34c (diff)
downloadpdfium-171cb27a720036c48ae3a6176084e880742af0a9.tar.xz
Remove default params from xfa/fde code.
This CL removes the default params from methods in xfa/fde. Change-Id: Ide93a51430c62753656b9e9c0bcd842d8179aa3c Reviewed-on: https://pdfium-review.googlesource.com/10952 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtengine.cpp')
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index 4701d452aa..1e1f86962d 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -186,7 +186,7 @@ CFX_WideString CFDE_TxtEdtEngine::GetText(int32_t nStart,
}
void CFDE_TxtEdtEngine::ClearText() {
- DeleteRange(0, -1);
+ DeleteRange(0, GetTextBufLength());
}
int32_t CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF& rtCaret) const {
@@ -430,8 +430,8 @@ int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, bool bBackspace) {
}
CFX_WideString wsRange = m_pTxtBuf->GetRange(nStart, nCount);
m_Param.pEventSink->OnAddDoRecord(
- pdfium::MakeUnique<CFDE_TxtEdtDoRecord_DeleteRange>(this, nStart,
- m_nCaret, wsRange));
+ pdfium::MakeUnique<CFDE_TxtEdtDoRecord_DeleteRange>(
+ this, nStart, m_nCaret, wsRange, false));
m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
m_ChangeInfo.wsDelete = GetText(nStart, nCount);
@@ -442,11 +442,9 @@ int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, bool bBackspace) {
return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
-int32_t CFDE_TxtEdtEngine::DeleteRange(int32_t nStart, int32_t nCount) {
+int32_t CFDE_TxtEdtEngine::DeleteRange(int32_t nStart, size_t nCount) {
if (IsLocked())
return FDE_TXTEDT_MODIFY_RET_F_Locked;
- if (nCount == -1)
- nCount = GetTextBufLength();
if (nCount == 0)
return FDE_TXTEDT_MODIFY_RET_S_Normal;
if (m_Param.dwMode & FDE_TEXTEDITMODE_Validate) {
@@ -454,7 +452,7 @@ int32_t CFDE_TxtEdtEngine::DeleteRange(int32_t nStart, int32_t nCount) {
if (!m_Param.pEventSink->OnValidate(wsText))
return FDE_TXTEDT_MODIFY_RET_F_Invalidate;
}
- DeleteRange_DoRecord(nStart, nCount);
+ DeleteRange_DoRecord(nStart, nCount, false);
m_Param.pEventSink->OnTextChanged(m_ChangeInfo);
SetCaretPos(nStart, true);
return FDE_TXTEDT_MODIFY_RET_S_Normal;
@@ -903,7 +901,7 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() {
wchar_t wChar = L' ';
int32_t nParagStart = 0;
int32_t nIndex = 0;
- auto pIter = pdfium::MakeUnique<CFDE_TxtEdtBuf::Iterator>(m_pTxtBuf.get());
+ auto pIter = pdfium::MakeUnique<CFDE_TxtEdtBuf::Iterator>(m_pTxtBuf.get(), 0);
pIter->SetAt(0);
do {
wChar = pIter->GetChar();