From 1bbedec89cc59df3e305dc25082d9699237d70ab Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 23 Mar 2017 09:13:37 -0400 Subject: Remove unused XFA_VALIDATE code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The XFA Validation flag is always set to preSubmit. This Cl removes the flag and other values and just uses the preSubmit option. Change-Id: Ic2e88d72ad94b605a2da355c4c0a56def47df73e Reviewed-on: https://pdfium-review.googlesource.com/3153 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- xfa/fxfa/app/cxfa_eventparam.cpp | 4 +--- xfa/fxfa/app/xfa_ffdocview.cpp | 28 +++++++--------------------- xfa/fxfa/cxfa_eventparam.h | 1 - xfa/fxfa/fxfa.h | 4 ---- 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/xfa/fxfa/app/cxfa_eventparam.cpp b/xfa/fxfa/app/cxfa_eventparam.cpp index bcce7219bc..bd6742f4dd 100644 --- a/xfa/fxfa/app/cxfa_eventparam.cpp +++ b/xfa/fxfa/app/cxfa_eventparam.cpp @@ -19,8 +19,7 @@ CXFA_EventParam::CXFA_EventParam() m_iSelEnd(0), m_iSelStart(0), m_bShift(false), - m_bIsFormReady(false), - m_iValidateActivities(XFA_VALIDATE_preSubmit) {} + m_bIsFormReady(false) {} CXFA_EventParam::~CXFA_EventParam() {} @@ -44,5 +43,4 @@ void CXFA_EventParam::Reset() { m_wsSoapFaultCode.clear(); m_wsSoapFaultString.clear(); m_bIsFormReady = false; - m_iValidateActivities = XFA_VALIDATE_preSubmit; } diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index 210002c530..b2ed1e907c 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -274,42 +274,28 @@ int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, ? pPresentNode->GetChild(0, XFA_Element::Validate) : nullptr; } - if (pValidateNode) { + if (pValidateNode) wsValidateStr = pValidateNode->GetContent(); - } - } - bool bValidate = false; - switch (pParam->m_iValidateActivities) { - case XFA_VALIDATE_preSubmit: - bValidate = wsValidateStr.Find(L"preSubmit") != -1; - break; - case XFA_VALIDATE_prePrint: - bValidate = wsValidateStr.Find(L"prePrint") != -1; - break; - case XFA_VALIDATE_preExecute: - bValidate = wsValidateStr.Find(L"preExecute") != -1; - break; - case XFA_VALIDATE_preSave: - bValidate = wsValidateStr.Find(L"preSave") != -1; - break; } - if (!bValidate) { + + if (wsValidateStr.Find(L"preSubmit") == -1) return XFA_EVENTERROR_Success; - } } + CXFA_Node* pNode = pWidgetAcc ? pWidgetAcc->GetNode() : nullptr; if (!pNode) { CXFA_Node* pRootItem = ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form)); - if (!pRootItem) { + if (!pRootItem) return XFA_EVENTERROR_Error; - } + pNode = pRootItem->GetChild(0, XFA_Element::Subform); } ExecEventActivityByDeepFirst(pNode, pParam->m_eType, pParam->m_bIsFormReady, true, nullptr); return XFA_EVENTERROR_Success; } + CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() { if (!m_pWidgetHandler) m_pWidgetHandler = pdfium::MakeUnique(this); diff --git a/xfa/fxfa/cxfa_eventparam.h b/xfa/fxfa/cxfa_eventparam.h index 3ba7a8b7f2..1e7c12a34a 100644 --- a/xfa/fxfa/cxfa_eventparam.h +++ b/xfa/fxfa/cxfa_eventparam.h @@ -73,7 +73,6 @@ class CXFA_EventParam { CFX_WideString m_wsSoapFaultCode; CFX_WideString m_wsSoapFaultString; bool m_bIsFormReady; - int32_t m_iValidateActivities; }; #endif // XFA_FXFA_CXFA_EVENTPARAM_H_ diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h index 38b11ee17c..0820a79d22 100644 --- a/xfa/fxfa/fxfa.h +++ b/xfa/fxfa/fxfa.h @@ -47,10 +47,6 @@ class IXFA_WidgetIterator; #define XFA_PARSESTATUS_SyntaxErr -1 #define XFA_PARSESTATUS_Ready 0 #define XFA_PARSESTATUS_Done 100 -#define XFA_VALIDATE_preSubmit 1 -#define XFA_VALIDATE_prePrint 2 -#define XFA_VALIDATE_preExecute 3 -#define XFA_VALIDATE_preSave 4 #define XFA_PRINTOPT_ShowDialog 0x00000001 #define XFA_PRINTOPT_CanCancel 0x00000002 -- cgit v1.2.3