Index: xfa/fxfa/app/cxfa_ffnumericeditdelegate.cpp |
diff --git a/xfa/fxfa/app/cxfa_ffnumericeditdelegate.cpp b/xfa/fxfa/app/cxfa_ffnumericeditdelegate.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b3b94842abdb06c39f551ace1ef1ad14c4649d7f |
--- /dev/null |
+++ b/xfa/fxfa/app/cxfa_ffnumericeditdelegate.cpp |
@@ -0,0 +1,30 @@ |
+// Copyright 2016 PDFium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
+ |
+#include "xfa/fxfa/app/cxfa_ffnumericeditdelegate.h" |
+ |
+#include "xfa/fwl/core/ifwl_edit.h" |
+#include "xfa/fxfa/app/xfa_fffield.h" |
+#include "xfa/fxfa/app/xfa_fftextedit.h" |
+ |
+CXFA_FFNumericEditDelegate::CXFA_FFNumericEditDelegate( |
+ std::unique_ptr<IFWL_WidgetDelegate> pDelegate, |
+ CXFA_FFNumericEdit* const pWidget) |
+ : CXFA_FFTextEditDelegate(std::move(pDelegate), pWidget) {} |
+ |
+CXFA_FFNumericEditDelegate::~CXFA_FFNumericEditDelegate() {} |
+ |
+void CXFA_FFNumericEditDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
+ if (pEvent->GetClassID() == CFWL_EventType::Validate) { |
+ CFWL_EvtEdtValidate* event = static_cast<CFWL_EvtEdtValidate*>(pEvent); |
+ CXFA_FFNumericEdit* widget = static_cast<CXFA_FFNumericEdit*>(m_pWidget); |
+ CFX_WideString wsChange = event->wsInsert; |
+ event->bValidate = |
+ widget->OnValidate(widget->GetNormalWidget()->GetWidget(), wsChange); |
+ return; |
+ } |
+ CXFA_FFTextEditDelegate::OnProcessEvent(pEvent); |
+} |