summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_edit.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-21 15:08:17 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-23 14:42:49 +0000
commit3bb0a34cc75abe49a59c6390353957bbb5c5ab38 (patch)
tree579b58399f24d3e12f39b4a0c9defcb1c56ad1bf /xfa/fwl/cfwl_edit.cpp
parent1d3696d091bd0485de55daedb000cef87fa35aae (diff)
downloadpdfium-3bb0a34cc75abe49a59c6390353957bbb5c5ab38.tar.xz
Convert the CFDE_TxtEdtEngine::Insert results into an enum class
This CL converts the return value to be an enum class and updates the usages to use the names instead of values. Change-Id: I8b6927551679ac4103775a04187daad2e0d6c569 Reviewed-on: https://pdfium-review.googlesource.com/11512 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_edit.cpp')
-rw-r--r--xfa/fwl/cfwl_edit.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 127c258d04..6e56ab2485 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -351,8 +351,8 @@ bool CFWL_Edit::Cut(CFX_WideString& wsCut) {
}
bool CFWL_Edit::Paste(const CFX_WideString& wsPaste) {
- int32_t iError = m_EdtEngine.Insert(wsPaste);
- if (iError < 0) {
+ FDE_EditResult iError = m_EdtEngine.Insert(wsPaste);
+ if (iError != FDE_EditResult::kSuccess) {
ProcessInsertError(iError);
return false;
}
@@ -1188,11 +1188,11 @@ void CFWL_Edit::ClearRecord() {
m_DoRecords.clear();
}
-void CFWL_Edit::ProcessInsertError(int32_t iError) {
+void CFWL_Edit::ProcessInsertError(FDE_EditResult iError) {
// TODO(dsinclair): This should probably also send events for Validation
// failure ....
- if (iError != -2)
+ if (iError != FDE_EditResult::kFull)
return;
CFWL_Event textFullEvent(CFWL_Event::Type::TextFull, this);
@@ -1432,7 +1432,7 @@ void CFWL_Edit::OnChar(CFWL_MessageKey* pMsg) {
return;
}
- int32_t iError = 0;
+ FDE_EditResult iError = FDE_EditResult::kSuccess;
wchar_t c = static_cast<wchar_t>(pMsg->m_dwKeyCode);
switch (c) {
case FWL_VKEY_Back:
@@ -1475,7 +1475,7 @@ void CFWL_Edit::OnChar(CFWL_MessageKey* pMsg) {
break;
}
}
- if (iError < 0)
+ if (iError != FDE_EditResult::kSuccess)
ProcessInsertError(iError);
}