diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-04 11:38:38 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 18:26:32 +0000 |
commit | c1e5756a43020665855d9d309c47b9dfe625b54f (patch) | |
tree | 76d14b1c20299fd6687927d428ba4cccce1ab0fe | |
parent | d9dfb6cc16f689753e9b3f896fbda1aec791051a (diff) | |
download | pdfium-c1e5756a43020665855d9d309c47b9dfe625b54f.tar.xz |
Move ProcessValueChanged from CXFA_WidgetAcc to CXFA_FFDocView
The ProcessValueChanged method works on the DocView data and uses the
WidgetAcc as a parameter. This CL moves the code to docview and passes
the WidgetAcc as a parameter.
Change-Id: I2f9531263c8578931bb44ef247ff281f1f8b4cf7
Reviewed-on: https://pdfium-review.googlesource.com/22253
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffdocview.cpp | 7 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffdocview.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_widgetacc.cpp | 8 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_widgetacc.h | 1 |
5 files changed, 13 insertions, 11 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index ff82283516..9911370dfc 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -319,8 +319,10 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) { } } - if (bSynchronizeElse) - pWidgetAcc->ProcessValueChanged(); + if (bSynchronizeElse) { + CPDFXFA_Context* context = m_pPageView->GetFormFillEnv()->GetXFAContext(); + context->GetXFADocView()->ProcessValueChanged(pWidgetAcc); + } } void CPDFSDK_Widget::SynchronizeXFAValue() { diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index e5d2fe12dc..cb4c72d0b3 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -672,6 +672,13 @@ void CXFA_FFDocView::InitCalculate(CXFA_Node* pNode) { nullptr); } +void CXFA_FFDocView::ProcessValueChanged(CXFA_WidgetAcc* widgetAcc) { + AddValidateWidget(widgetAcc); + AddCalculateWidgetAcc(widgetAcc); + RunCalculateWidgets(); + RunValidate(); +} + bool CXFA_FFDocView::InitValidate(CXFA_Node* pNode) { if (!m_pDoc->GetDocEnvironment()->IsValidationsEnabled(m_pDoc.Get())) return false; diff --git a/xfa/fxfa/cxfa_ffdocview.h b/xfa/fxfa/cxfa_ffdocview.h index f980ad2feb..fcaa7162dd 100644 --- a/xfa/fxfa/cxfa_ffdocview.h +++ b/xfa/fxfa/cxfa_ffdocview.h @@ -79,6 +79,8 @@ class CXFA_FFDocView { void RunDocClose(); void DestroyDocView(); + void ProcessValueChanged(CXFA_WidgetAcc* widgetAcc); + bool InitValidate(CXFA_Node* pNode); bool RunValidate(); diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index 47a9c942b0..f735633abe 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -376,14 +376,6 @@ CXFA_Node* CXFA_WidgetAcc::GetDatasets() { return m_pNode->GetBindData(); } -bool CXFA_WidgetAcc::ProcessValueChanged() { - m_pDocView->AddValidateWidget(this); - m_pDocView->AddCalculateWidgetAcc(this); - m_pDocView->RunCalculateWidgets(); - m_pDocView->RunValidate(); - return true; -} - void CXFA_WidgetAcc::ResetData() { WideString wsValue; XFA_Element eUIType = GetUIType(); diff --git a/xfa/fxfa/cxfa_widgetacc.h b/xfa/fxfa/cxfa_widgetacc.h index 29c78d9576..2736f59139 100644 --- a/xfa/fxfa/cxfa_widgetacc.h +++ b/xfa/fxfa/cxfa_widgetacc.h @@ -68,7 +68,6 @@ class CXFA_WidgetAcc { CXFA_WidgetAcc* GetExclGroup(); CXFA_FFDoc* GetDoc(); - bool ProcessValueChanged(); int32_t ProcessEvent(XFA_AttributeEnum iActivity, CXFA_EventParam* pEventParam); int32_t ProcessEvent(CXFA_Event* event, CXFA_EventParam* pEventParam); |