summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-30 18:56:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 18:56:50 +0000
commit8cdea72a82aae5e07aa92e9886dbbe635eb8b7cc (patch)
treeff632b087b2770a117581696384bd0a429d86d55 /fpdfsdk/cpdfsdk_widget.cpp
parent95dd8dad6b1b2ac31aca84afe677205c7ed47f7f (diff)
downloadpdfium-8cdea72a82aae5e07aa92e9886dbbe635eb8b7cc.tar.xz
Cleanup duplicate RunScript code
This CL consolidates the duplicate RunScript code in CPDFSDK_ActionHandler. Change-Id: I08beb7644b6cbaa7906e5bb302372fd8a670f32a Reviewed-on: https://pdfium-review.googlesource.com/24630 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index fc67059025..d0eaa7adc8 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -221,7 +221,7 @@ bool CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) {
}
bool CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
- PDFSDK_FieldAction& data,
+ PDFSDK_FieldAction* data,
CPDFSDK_PageView* pPageView) {
CPDFXFA_Context* pContext = m_pPageView->GetFormFillEnv()->GetXFAContext();
@@ -239,22 +239,22 @@ bool CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
CXFA_EventParam param;
param.m_eType = eEventType;
- param.m_wsChange = data.sChange;
- param.m_iCommitKey = data.nCommitKey;
- param.m_bShift = data.bShift;
- param.m_iSelStart = data.nSelStart;
- param.m_iSelEnd = data.nSelEnd;
- param.m_wsFullText = data.sValue;
- param.m_bKeyDown = data.bKeyDown;
- param.m_bModifier = data.bModifier;
- param.m_wsNewText = data.sValue;
- if (data.nSelEnd > data.nSelStart)
- param.m_wsNewText.Delete(data.nSelStart, data.nSelEnd - data.nSelStart);
-
- for (const auto& c : data.sChange)
- param.m_wsNewText.Insert(data.nSelStart, c);
-
- param.m_wsPrevText = data.sValue;
+ param.m_wsChange = data->sChange;
+ param.m_iCommitKey = data->nCommitKey;
+ param.m_bShift = data->bShift;
+ param.m_iSelStart = data->nSelStart;
+ param.m_iSelEnd = data->nSelEnd;
+ param.m_wsFullText = data->sValue;
+ param.m_bKeyDown = data->bKeyDown;
+ param.m_bModifier = data->bModifier;
+ param.m_wsNewText = data->sValue;
+ if (data->nSelEnd > data->nSelStart)
+ param.m_wsNewText.Delete(data->nSelStart, data->nSelEnd - data->nSelStart);
+
+ for (const auto& c : data->sChange)
+ param.m_wsNewText.Insert(data->nSelStart, c);
+
+ param.m_wsPrevText = data->sValue;
if ((eEventType == XFA_EVENT_Click || eEventType == XFA_EVENT_Change) &&
GetFieldType() == FormFieldType::kRadioButton) {
if (CXFA_FFWidget* hGroupWidget = GetGroupMixXFAWidget()) {
@@ -831,34 +831,34 @@ CFX_Color CPDFSDK_Widget::GetFillPWLColor() const {
}
bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& data,
+ PDFSDK_FieldAction* data,
CPDFSDK_PageView* pPageView) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = pPageView->GetFormFillEnv();
#ifdef PDF_ENABLE_XFA
CPDFXFA_Context* pContext = pFormFillEnv->GetXFAContext();
if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) {
- XFA_EVENTTYPE eEventType = GetXFAEventType(type, data.bWillCommit);
+ XFA_EVENTTYPE eEventType = GetXFAEventType(type, data->bWillCommit);
if (eEventType != XFA_EVENT_Unknown) {
if (CXFA_FFWidgetHandler* pXFAWidgetHandler = GetXFAWidgetHandler()) {
CXFA_EventParam param;
param.m_eType = eEventType;
- param.m_wsChange = data.sChange;
- param.m_iCommitKey = data.nCommitKey;
- param.m_bShift = data.bShift;
- param.m_iSelStart = data.nSelStart;
- param.m_iSelEnd = data.nSelEnd;
- param.m_wsFullText = data.sValue;
- param.m_bKeyDown = data.bKeyDown;
- param.m_bModifier = data.bModifier;
- param.m_wsNewText = data.sValue;
- if (data.nSelEnd > data.nSelStart)
- param.m_wsNewText.Delete(data.nSelStart,
- data.nSelEnd - data.nSelStart);
- for (int i = data.sChange.GetLength() - 1; i >= 0; i--)
- param.m_wsNewText.Insert(data.nSelStart, data.sChange[i]);
- param.m_wsPrevText = data.sValue;
+ param.m_wsChange = data->sChange;
+ param.m_iCommitKey = data->nCommitKey;
+ param.m_bShift = data->bShift;
+ param.m_iSelStart = data->nSelStart;
+ param.m_iSelEnd = data->nSelEnd;
+ param.m_wsFullText = data->sValue;
+ param.m_bKeyDown = data->bKeyDown;
+ param.m_bModifier = data->bModifier;
+ param.m_wsNewText = data->sValue;
+ if (data->nSelEnd > data->nSelStart)
+ param.m_wsNewText.Delete(data->nSelStart,
+ data->nSelEnd - data->nSelStart);
+ for (int i = data->sChange.GetLength() - 1; i >= 0; i--)
+ param.m_wsNewText.Insert(data->nSelStart, data->sChange[i]);
+ param.m_wsPrevText = data->sValue;
int32_t nRet = XFA_EVENTERROR_NotExist;
CXFA_Node* node = hWidget->GetNode();