From b8656256af8855c652415095438d5c932790a2b2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Nov 2017 21:34:30 +0000 Subject: Rename CXFA_Submit to CXFA_SubmitData This CL renames CXFA_Submit to CXFA_SubmitData to show it's part of the data hierarchy. Change-Id: I6f580a28e41e54ffa1f1c7b799d97f079303463f Reviewed-on: https://pdfium-review.googlesource.com/18014 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- BUILD.gn | 4 ++-- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 15 ++++++++------- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h | 4 ++-- xfa/fxfa/cxfa_widgetacc.cpp | 4 ++-- xfa/fxfa/fxfa.h | 2 +- xfa/fxfa/parser/cxfa_eventdata.cpp | 4 ++-- xfa/fxfa/parser/cxfa_eventdata.h | 4 ++-- xfa/fxfa/parser/cxfa_submit.cpp | 27 --------------------------- xfa/fxfa/parser/cxfa_submit.h | 26 -------------------------- xfa/fxfa/parser/cxfa_submitdata.cpp | 27 +++++++++++++++++++++++++++ xfa/fxfa/parser/cxfa_submitdata.h | 26 ++++++++++++++++++++++++++ 11 files changed, 72 insertions(+), 71 deletions(-) delete mode 100644 xfa/fxfa/parser/cxfa_submit.cpp delete mode 100644 xfa/fxfa/parser/cxfa_submit.h create mode 100644 xfa/fxfa/parser/cxfa_submitdata.cpp create mode 100644 xfa/fxfa/parser/cxfa_submitdata.h diff --git a/BUILD.gn b/BUILD.gn index bb724d50d5..29d83a5fed 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1869,8 +1869,8 @@ if (pdf_enable_xfa) { "xfa/fxfa/parser/cxfa_simple_parser.h", "xfa/fxfa/parser/cxfa_strokedata.cpp", "xfa/fxfa/parser/cxfa_strokedata.h", - "xfa/fxfa/parser/cxfa_submit.cpp", - "xfa/fxfa/parser/cxfa_submit.h", + "xfa/fxfa/parser/cxfa_submitdata.cpp", + "xfa/fxfa/parser/cxfa_submitdata.h", "xfa/fxfa/parser/cxfa_text.cpp", "xfa/fxfa/parser/cxfa_text.h", "xfa/fxfa/parser/cxfa_thisproxy.cpp", diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 6040517d93..a49b25fc57 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -680,12 +680,13 @@ void CPDFXFA_DocEnvironment::OnAfterNotifySubmit() { m_pContext->GetXFADocView()->UpdateDocView(); } -bool CPDFXFA_DocEnvironment::SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) { +bool CPDFXFA_DocEnvironment::SubmitData(CXFA_FFDoc* hDoc, + CXFA_SubmitData submitData) { if (!NotifySubmit(true) || !m_pContext->GetXFADocView()) return false; m_pContext->GetXFADocView()->UpdateDocView(); - bool ret = SubmitDataInternal(hDoc, submit); + bool ret = SubmitDataInternal(hDoc, submitData); NotifySubmit(false); return ret; } @@ -889,13 +890,13 @@ bool CPDFXFA_DocEnvironment::MailToInfo(WideString& csURL, } bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, - CXFA_Submit submit) { + CXFA_SubmitData submitData) { CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv(); if (!pFormFillEnv) return false; WideStringView csURLC; - submit.GetSubmitTarget(csURLC); + submitData.GetSubmitTarget(csURLC); WideString csURL(csURLC); if (csURL.IsEmpty()) { WideString ws; @@ -910,10 +911,10 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, FPDF_FILEHANDLER* pFileHandler = nullptr; int fileFlag = -1; - switch (submit.GetSubmitFormat()) { + switch (submitData.GetSubmitFormat()) { case XFA_ATTRIBUTEENUM_Xdp: { WideStringView csContentC; - submit.GetSubmitXDPContent(csContentC); + submitData.GetSubmitXDPContent(csContentC); WideString csContent; csContent = csContentC; csContent.TrimLeft(); @@ -922,7 +923,7 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, space.FromLocal(" "); csContent = space + csContent + space; FPDF_DWORD flag = 0; - if (submit.IsSubmitEmbedPDF()) + if (submitData.IsSubmitEmbedPDF()) flag |= FXFA_PDF; ToXFAContentFlags(csContent, flag); diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h index 62830b0804..24a61dd773 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h @@ -76,7 +76,7 @@ class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment { * @param[in] bEmbedPDF, specifies whether PDF is embedded in the submitted *content or not. */ - bool SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) override; + bool SubmitData(CXFA_FFDoc* hDoc, CXFA_SubmitData submitData) override; bool GetGlobalProperty(CXFA_FFDoc* hDoc, const ByteStringView& szPropName, @@ -93,7 +93,7 @@ class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment { bool OnBeforeNotifySubmit(); void OnAfterNotifySubmit(); bool NotifySubmit(bool bPrevOrPost); - bool SubmitDataInternal(CXFA_FFDoc* hDoc, CXFA_Submit submit); + bool SubmitDataInternal(CXFA_FFDoc* hDoc, CXFA_SubmitData submitData); bool MailToInfo(WideString& csURL, WideString& csToAddress, WideString& csCCAddress, diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index 59df6c9f4d..04733934a8 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -310,8 +310,8 @@ int32_t CXFA_WidgetAcc::ProcessEvent(const CXFA_EventData& eventData, case XFA_Element::SignData: break; case XFA_Element::Submit: - return GetDoc()->GetDocEnvironment()->SubmitData(GetDoc(), - eventData.GetSubmit()); + return GetDoc()->GetDocEnvironment()->SubmitData( + GetDoc(), eventData.GetSubmitData()); default: break; } diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h index bb6864a6a4..b0f70f1fd7 100644 --- a/xfa/fxfa/fxfa.h +++ b/xfa/fxfa/fxfa.h @@ -257,7 +257,7 @@ class IXFA_DocEnvironment { uint32_t dwOptions) = 0; virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) = 0; - virtual bool SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) = 0; + virtual bool SubmitData(CXFA_FFDoc* hDoc, CXFA_SubmitData submitData) = 0; virtual bool GetGlobalProperty(CXFA_FFDoc* hDoc, const ByteStringView& szPropName, CFXJSE_Value* pValue) = 0; diff --git a/xfa/fxfa/parser/cxfa_eventdata.cpp b/xfa/fxfa/parser/cxfa_eventdata.cpp index 22943216c4..5d20e35718 100644 --- a/xfa/fxfa/parser/cxfa_eventdata.cpp +++ b/xfa/fxfa/parser/cxfa_eventdata.cpp @@ -34,8 +34,8 @@ CXFA_ScriptData CXFA_EventData::GetScriptData() const { return CXFA_ScriptData(m_pNode->GetChild(0, XFA_Element::Script, false)); } -CXFA_Submit CXFA_EventData::GetSubmit() const { - return CXFA_Submit(m_pNode->GetChild(0, XFA_Element::Submit, false)); +CXFA_SubmitData CXFA_EventData::GetSubmitData() const { + return CXFA_SubmitData(m_pNode->GetChild(0, XFA_Element::Submit, false)); } void CXFA_EventData::GetSignDataTarget(WideString& wsTarget) { diff --git a/xfa/fxfa/parser/cxfa_eventdata.h b/xfa/fxfa/parser/cxfa_eventdata.h index e9a79f008f..5c96b07148 100644 --- a/xfa/fxfa/parser/cxfa_eventdata.h +++ b/xfa/fxfa/parser/cxfa_eventdata.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_string.h" #include "xfa/fxfa/parser/cxfa_data.h" #include "xfa/fxfa/parser/cxfa_scriptdata.h" -#include "xfa/fxfa/parser/cxfa_submit.h" +#include "xfa/fxfa/parser/cxfa_submitdata.h" class CXFA_Node; @@ -23,7 +23,7 @@ class CXFA_EventData : public CXFA_Data { int32_t GetActivity(); XFA_Element GetEventType() const; CXFA_ScriptData GetScriptData() const; - CXFA_Submit GetSubmit() const; + CXFA_SubmitData GetSubmitData() const; void GetRef(WideStringView& wsRef); void GetSignDataTarget(WideString& wsTarget); }; diff --git a/xfa/fxfa/parser/cxfa_submit.cpp b/xfa/fxfa/parser/cxfa_submit.cpp deleted file mode 100644 index b7802c0248..0000000000 --- a/xfa/fxfa/parser/cxfa_submit.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// 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/parser/cxfa_submit.h" - -#include "xfa/fxfa/parser/cxfa_node.h" - -CXFA_Submit::CXFA_Submit(CXFA_Node* pNode) : CXFA_Data(pNode) {} - -bool CXFA_Submit::IsSubmitEmbedPDF() { - return m_pNode->JSNode()->GetBoolean(XFA_ATTRIBUTE_EmbedPDF); -} - -int32_t CXFA_Submit::GetSubmitFormat() { - return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Format); -} - -void CXFA_Submit::GetSubmitTarget(WideStringView& wsTarget) { - m_pNode->JSNode()->TryCData(XFA_ATTRIBUTE_Target, wsTarget, true); -} - -void CXFA_Submit::GetSubmitXDPContent(WideStringView& wsContent) { - m_pNode->JSNode()->TryCData(XFA_ATTRIBUTE_XdpContent, wsContent, true); -} diff --git a/xfa/fxfa/parser/cxfa_submit.h b/xfa/fxfa/parser/cxfa_submit.h deleted file mode 100644 index 9d4d7fe281..0000000000 --- a/xfa/fxfa/parser/cxfa_submit.h +++ /dev/null @@ -1,26 +0,0 @@ -// 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 - -#ifndef XFA_FXFA_PARSER_CXFA_SUBMIT_H_ -#define XFA_FXFA_PARSER_CXFA_SUBMIT_H_ - -#include "core/fxcrt/fx_string.h" -#include "core/fxcrt/fx_system.h" -#include "xfa/fxfa/parser/cxfa_data.h" - -class CXFA_Node; - -class CXFA_Submit : public CXFA_Data { - public: - explicit CXFA_Submit(CXFA_Node* pNode); - - bool IsSubmitEmbedPDF(); - int32_t GetSubmitFormat(); - void GetSubmitTarget(WideStringView& wsTarget); - void GetSubmitXDPContent(WideStringView& wsContent); -}; - -#endif // XFA_FXFA_PARSER_CXFA_SUBMIT_H_ diff --git a/xfa/fxfa/parser/cxfa_submitdata.cpp b/xfa/fxfa/parser/cxfa_submitdata.cpp new file mode 100644 index 0000000000..d0f7d8f8ad --- /dev/null +++ b/xfa/fxfa/parser/cxfa_submitdata.cpp @@ -0,0 +1,27 @@ +// 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/parser/cxfa_submitdata.h" + +#include "xfa/fxfa/parser/cxfa_node.h" + +CXFA_SubmitData::CXFA_SubmitData(CXFA_Node* pNode) : CXFA_Data(pNode) {} + +bool CXFA_SubmitData::IsSubmitEmbedPDF() { + return m_pNode->JSNode()->GetBoolean(XFA_ATTRIBUTE_EmbedPDF); +} + +int32_t CXFA_SubmitData::GetSubmitFormat() { + return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Format); +} + +void CXFA_SubmitData::GetSubmitTarget(WideStringView& wsTarget) { + m_pNode->JSNode()->TryCData(XFA_ATTRIBUTE_Target, wsTarget, true); +} + +void CXFA_SubmitData::GetSubmitXDPContent(WideStringView& wsContent) { + m_pNode->JSNode()->TryCData(XFA_ATTRIBUTE_XdpContent, wsContent, true); +} diff --git a/xfa/fxfa/parser/cxfa_submitdata.h b/xfa/fxfa/parser/cxfa_submitdata.h new file mode 100644 index 0000000000..b5005f34a8 --- /dev/null +++ b/xfa/fxfa/parser/cxfa_submitdata.h @@ -0,0 +1,26 @@ +// 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 + +#ifndef XFA_FXFA_PARSER_CXFA_SUBMITDATA_H_ +#define XFA_FXFA_PARSER_CXFA_SUBMITDATA_H_ + +#include "core/fxcrt/fx_string.h" +#include "core/fxcrt/fx_system.h" +#include "xfa/fxfa/parser/cxfa_data.h" + +class CXFA_Node; + +class CXFA_SubmitData : public CXFA_Data { + public: + explicit CXFA_SubmitData(CXFA_Node* pNode); + + bool IsSubmitEmbedPDF(); + int32_t GetSubmitFormat(); + void GetSubmitTarget(WideStringView& wsTarget); + void GetSubmitXDPContent(WideStringView& wsContent); +}; + +#endif // XFA_FXFA_PARSER_CXFA_SUBMITDATA_H_ -- cgit v1.2.3