diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-07 20:08:31 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-07 20:08:31 +0000 |
commit | c8be4ce787252eaf3b03270bc99fe1e9e9044543 (patch) | |
tree | 83bc4eed903e5e1af2107a0238554d6e5195fc2a /xfa/fxfa | |
parent | b415ffb47de6e58603db2a01027aa879c0126b24 (diff) | |
download | pdfium-c8be4ce787252eaf3b03270bc99fe1e9e9044543.tar.xz |
Rename CXFA_Event to CXFA_EventData
This CL renames CXFA_Event to CXFA_EventData to make it clear it's part
of the Data hierarchy.
Change-Id: I3659dfba66498d07ce75fd5e8322732f9898e688
Reviewed-on: https://pdfium-review.googlesource.com/17980
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/cxfa_widgetacc.cpp | 12 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_widgetacc.h | 5 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_eventdata.cpp (renamed from xfa/fxfa/parser/cxfa_event.cpp) | 16 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_eventdata.h (renamed from xfa/fxfa/parser/cxfa_event.h) | 10 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 8 |
5 files changed, 26 insertions, 25 deletions
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index 9be0bdb203..ea262f874d 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -287,7 +287,7 @@ int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, bool first = true; int32_t iRet = XFA_EVENTERROR_NotExist; for (CXFA_Node* pNode : eventArray) { - int32_t result = ProcessEvent(CXFA_Event(pNode), pEventParam); + int32_t result = ProcessEvent(CXFA_EventData(pNode), pEventParam); if (first || result == XFA_EVENTERROR_Success) iRet = result; first = false; @@ -295,21 +295,21 @@ int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, return iRet; } -int32_t CXFA_WidgetAcc::ProcessEvent(const CXFA_Event& event, +int32_t CXFA_WidgetAcc::ProcessEvent(const CXFA_EventData& eventData, CXFA_EventParam* pEventParam) { - if (!event) + if (!eventData) return XFA_EVENTERROR_NotExist; - switch (event.GetEventType()) { + switch (eventData.GetEventType()) { case XFA_Element::Execute: break; case XFA_Element::Script: - return ExecuteScript(event.GetScript(), pEventParam); + return ExecuteScript(eventData.GetScript(), pEventParam); case XFA_Element::SignData: break; case XFA_Element::Submit: return GetDoc()->GetDocEnvironment()->SubmitData(GetDoc(), - event.GetSubmit()); + eventData.GetSubmit()); default: break; } diff --git a/xfa/fxfa/cxfa_widgetacc.h b/xfa/fxfa/cxfa_widgetacc.h index 718dcf3a63..4d66ff3b5a 100644 --- a/xfa/fxfa/cxfa_widgetacc.h +++ b/xfa/fxfa/cxfa_widgetacc.h @@ -15,7 +15,7 @@ #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_boxdata.h" -#include "xfa/fxfa/parser/cxfa_event.h" +#include "xfa/fxfa/parser/cxfa_eventdata.h" #include "xfa/fxfa/parser/cxfa_image.h" #include "xfa/fxfa/parser/cxfa_margin.h" #include "xfa/fxfa/parser/cxfa_script.h" @@ -45,7 +45,8 @@ class CXFA_WidgetAcc : public CXFA_WidgetData { bool ProcessValueChanged(); int32_t ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam); - int32_t ProcessEvent(const CXFA_Event& event, CXFA_EventParam* pEventParam); + int32_t ProcessEvent(const CXFA_EventData& eventData, + CXFA_EventParam* pEventParam); int32_t ProcessCalculate(); int32_t ProcessValidate(int32_t iFlags); int32_t ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam); diff --git a/xfa/fxfa/parser/cxfa_event.cpp b/xfa/fxfa/parser/cxfa_eventdata.cpp index 8ba68fb294..5b48df6d88 100644 --- a/xfa/fxfa/parser/cxfa_event.cpp +++ b/xfa/fxfa/parser/cxfa_eventdata.cpp @@ -4,17 +4,17 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "xfa/fxfa/parser/cxfa_event.h" +#include "xfa/fxfa/parser/cxfa_eventdata.h" #include "xfa/fxfa/parser/cxfa_node.h" -CXFA_Event::CXFA_Event(CXFA_Node* pNode) : CXFA_Data(pNode) {} +CXFA_EventData::CXFA_EventData(CXFA_Node* pNode) : CXFA_Data(pNode) {} -int32_t CXFA_Event::GetActivity() { +int32_t CXFA_EventData::GetActivity() { return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Activity); } -XFA_Element CXFA_Event::GetEventType() const { +XFA_Element CXFA_EventData::GetEventType() const { CXFA_Node* pChild = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChild) { XFA_Element eType = pChild->GetElementType(); @@ -26,19 +26,19 @@ XFA_Element CXFA_Event::GetEventType() const { return XFA_Element::Unknown; } -void CXFA_Event::GetRef(WideStringView& wsRef) { +void CXFA_EventData::GetRef(WideStringView& wsRef) { m_pNode->JSNode()->TryCData(XFA_ATTRIBUTE_Ref, wsRef, true); } -CXFA_Script CXFA_Event::GetScript() const { +CXFA_Script CXFA_EventData::GetScript() const { return CXFA_Script(m_pNode->GetChild(0, XFA_Element::Script, false)); } -CXFA_Submit CXFA_Event::GetSubmit() const { +CXFA_Submit CXFA_EventData::GetSubmit() const { return CXFA_Submit(m_pNode->GetChild(0, XFA_Element::Submit, false)); } -void CXFA_Event::GetSignDataTarget(WideString& wsTarget) { +void CXFA_EventData::GetSignDataTarget(WideString& wsTarget) { CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::SignData, true); if (!pNode) diff --git a/xfa/fxfa/parser/cxfa_event.h b/xfa/fxfa/parser/cxfa_eventdata.h index 3835454c28..b6fdc48e99 100644 --- a/xfa/fxfa/parser/cxfa_event.h +++ b/xfa/fxfa/parser/cxfa_eventdata.h @@ -4,8 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#ifndef XFA_FXFA_PARSER_CXFA_EVENT_H_ -#define XFA_FXFA_PARSER_CXFA_EVENT_H_ +#ifndef XFA_FXFA_PARSER_CXFA_EVENTDATA_H_ +#define XFA_FXFA_PARSER_CXFA_EVENTDATA_H_ #include <stdint.h> @@ -16,9 +16,9 @@ class CXFA_Node; -class CXFA_Event : public CXFA_Data { +class CXFA_EventData : public CXFA_Data { public: - explicit CXFA_Event(CXFA_Node* pNode); + explicit CXFA_EventData(CXFA_Node* pNode); int32_t GetActivity(); XFA_Element GetEventType() const; @@ -28,4 +28,4 @@ class CXFA_Event : public CXFA_Data { void GetSignDataTarget(WideString& wsTarget); }; -#endif // XFA_FXFA_PARSER_CXFA_EVENT_H_ +#endif // XFA_FXFA_PARSER_CXFA_EVENTDATA_H_ diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index ccce8cf501..362f0b5e54 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -12,7 +12,7 @@ #include "third_party/base/stl_util.h" #include "xfa/fxfa/cxfa_ffnotify.h" #include "xfa/fxfa/parser/cxfa_document.h" -#include "xfa/fxfa/parser/cxfa_event.h" +#include "xfa/fxfa/parser/cxfa_eventdata.h" #include "xfa/fxfa/parser/cxfa_localevalue.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_node.h" @@ -311,11 +311,11 @@ std::vector<CXFA_Node*> CXFA_WidgetData::GetEventByActivity(int32_t iActivity, bool bIsFormReady) { std::vector<CXFA_Node*> events; for (CXFA_Node* pNode : GetEventList()) { - CXFA_Event event(pNode); - if (event.GetActivity() == iActivity) { + CXFA_EventData eventData(pNode); + if (eventData.GetActivity() == iActivity) { if (iActivity == XFA_ATTRIBUTEENUM_Ready) { WideStringView wsRef; - event.GetRef(wsRef); + eventData.GetRef(wsRef); if (bIsFormReady) { if (wsRef == WideStringView(L"$form")) events.push_back(pNode); |