From 72d718ffb0bb5320c94ca387cb4938d946b076fc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 21 Nov 2017 16:44:21 +0000 Subject: Cleanup CXFA_EventData methods This CL changes the GetRef method to return a WideString instead of taking an out param and removes the unused GetSignDataTarget method. Change-Id: If50c4243fa136000fda8e4411ada4cd9cd8b20d5 Reviewed-on: https://pdfium-review.googlesource.com/18911 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_eventdata.cpp | 13 ++----------- xfa/fxfa/parser/cxfa_eventdata.h | 3 +-- xfa/fxfa/parser/cxfa_widgetdata.cpp | 3 +-- 3 files changed, 4 insertions(+), 15 deletions(-) (limited to 'xfa') diff --git a/xfa/fxfa/parser/cxfa_eventdata.cpp b/xfa/fxfa/parser/cxfa_eventdata.cpp index b9b3c8c0c2..1485d8e0f5 100644 --- a/xfa/fxfa/parser/cxfa_eventdata.cpp +++ b/xfa/fxfa/parser/cxfa_eventdata.cpp @@ -26,8 +26,8 @@ XFA_Element CXFA_EventData::GetEventType() const { return XFA_Element::Unknown; } -void CXFA_EventData::GetRef(WideString& wsRef) { - wsRef = m_pNode->JSNode()->GetCData(XFA_Attribute::Ref); +WideString CXFA_EventData::GetRef() const { + return m_pNode->JSNode()->GetCData(XFA_Attribute::Ref); } CXFA_ScriptData CXFA_EventData::GetScriptData() const { @@ -37,12 +37,3 @@ CXFA_ScriptData CXFA_EventData::GetScriptData() const { CXFA_SubmitData CXFA_EventData::GetSubmitData() const { return CXFA_SubmitData(m_pNode->GetChild(0, XFA_Element::Submit, false)); } - -void CXFA_EventData::GetSignDataTarget(WideString& wsTarget) { - CXFA_Node* pNode = - m_pNode->JSNode()->GetProperty(0, XFA_Element::SignData, true); - if (!pNode) - return; - - wsTarget = pNode->JSNode()->GetCData(XFA_Attribute::Target); -} diff --git a/xfa/fxfa/parser/cxfa_eventdata.h b/xfa/fxfa/parser/cxfa_eventdata.h index 98b85e662e..a93d04352c 100644 --- a/xfa/fxfa/parser/cxfa_eventdata.h +++ b/xfa/fxfa/parser/cxfa_eventdata.h @@ -24,8 +24,7 @@ class CXFA_EventData : public CXFA_DataData { XFA_Element GetEventType() const; CXFA_ScriptData GetScriptData() const; CXFA_SubmitData GetSubmitData() const; - void GetRef(WideString& wsRef); - void GetSignDataTarget(WideString& wsTarget); + WideString GetRef() const; }; #endif // XFA_FXFA_PARSER_CXFA_EVENTDATA_H_ diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index d0efce71a0..4688aee390 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -283,8 +283,7 @@ std::vector CXFA_WidgetData::GetEventByActivity(int32_t iActivity, CXFA_EventData eventData(pNode); if (eventData.GetActivity() == iActivity) { if (iActivity == XFA_ATTRIBUTEENUM_Ready) { - WideString wsRef; - eventData.GetRef(wsRef); + WideString wsRef = eventData.GetRef(); if (bIsFormReady) { if (wsRef == WideStringView(L"$form")) events.push_back(pNode); -- cgit v1.2.3