From ccaf638782c9ed16b72e26598ecf9ddec7f12c94 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 6 Nov 2017 21:19:32 +0000 Subject: Remove CXFA_Validate::SetTestValue The method is called once, so fold into caller. Change-Id: I850e822969e203ce8f204ba2d8e5d99330b36e4b Reviewed-on: https://pdfium-review.googlesource.com/17855 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/parser/cxfa_validate.cpp | 16 ++++------------ xfa/fxfa/parser/cxfa_validate.h | 3 --- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp index 3b567c2e69..2f97a02a51 100644 --- a/xfa/fxfa/parser/cxfa_validate.cpp +++ b/xfa/fxfa/parser/cxfa_validate.cpp @@ -15,23 +15,15 @@ int32_t CXFA_Validate::GetFormatTest() { return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_FormatTest); } -bool CXFA_Validate::SetTestValue(int32_t iType, - WideString& wsValue, - XFA_ATTRIBUTEENUM eName) { +bool CXFA_Validate::SetNullTest(WideString wsValue) { const XFA_ATTRIBUTEENUMINFO* pInfo = XFA_GetAttributeEnumByName(wsValue.AsStringView()); - if (pInfo) - eName = pInfo->eName; - - m_pNode->JSNode()->SetEnum((XFA_ATTRIBUTE)iType, eName, false); + m_pNode->JSNode()->SetEnum(XFA_ATTRIBUTE_NullTest, + pInfo ? pInfo->eName : XFA_ATTRIBUTEENUM_Disabled, + false); return true; } -bool CXFA_Validate::SetNullTest(WideString wsValue) { - return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue, - XFA_ATTRIBUTEENUM_Disabled); -} - int32_t CXFA_Validate::GetNullTest() { return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_NullTest); } diff --git a/xfa/fxfa/parser/cxfa_validate.h b/xfa/fxfa/parser/cxfa_validate.h index ce4ba647cc..ebe3eaee56 100644 --- a/xfa/fxfa/parser/cxfa_validate.h +++ b/xfa/fxfa/parser/cxfa_validate.h @@ -34,9 +34,6 @@ class CXFA_Validate : public CXFA_Data { private: void GetMessageText(WideString& wsMessage, const WideString& wsMessageType); void SetMessageText(WideString& wsMessage, const WideString& wsMessageType); - bool SetTestValue(int32_t iType, - WideString& wsValue, - XFA_ATTRIBUTEENUM eName); }; #endif // XFA_FXFA_PARSER_CXFA_VALIDATE_H_ -- cgit v1.2.3