From 981a2908d7a213363772d1846a7c63c2cfd73c7e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 4 Jan 2018 13:42:29 -0500 Subject: Pass the FFDocView into CXFA_WidgetAcc::UpdateUIDisplay This Cl changes UpdateUIDisplay to accept the FFDocView as a parameter and removes the default value from the pExcept parameter. Change-Id: I4fb42421b6011c93c6c2b19cdd32d94184bc3fe3 Reviewed-on: https://pdfium-review.googlesource.com/22255 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffdatetimeedit.cpp | 2 +- xfa/fxfa/cxfa_ffdocview.cpp | 2 +- xfa/fxfa/cxfa_ffnotify.cpp | 4 ++-- xfa/fxfa/cxfa_fftextedit.cpp | 2 +- xfa/fxfa/cxfa_widgetacc.cpp | 7 ++++--- xfa/fxfa/cxfa_widgetacc.h | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffdatetimeedit.cpp b/xfa/fxfa/cxfa_ffdatetimeedit.cpp index 969d69c56b..d6b892360c 100644 --- a/xfa/fxfa/cxfa_ffdatetimeedit.cpp +++ b/xfa/fxfa/cxfa_ffdatetimeedit.cpp @@ -142,7 +142,7 @@ bool CXFA_FFDateTimeEdit::CommitData() { if (!m_pDataAcc->SetValue(XFA_VALUEPICTURE_Edit, pPicker->GetEditText())) return false; - m_pDataAcc->UpdateUIDisplay(this); + m_pDataAcc->UpdateUIDisplay(GetDoc()->GetDocView(), this); return true; } diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 5856809167..9468624780 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -227,7 +227,7 @@ bool CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) { return false; pWidgetAcc->ResetData(); - pWidgetAcc->UpdateUIDisplay(); + pWidgetAcc->UpdateUIDisplay(this, nullptr); CXFA_Validate* validate = pWidgetAcc->GetValidate(false); if (!validate) return true; diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index c7872f662b..1897a4e58f 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -424,12 +424,12 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, pDocView->AddCalculateNodeNotify(pSender); if (eType == XFA_Element::Value || bIsContainerNode) { if (bIsContainerNode) { - pWidgetAcc->UpdateUIDisplay(); + pWidgetAcc->UpdateUIDisplay(m_pDoc->GetDocView(), nullptr); pDocView->AddCalculateWidgetAcc(pWidgetAcc); pDocView->AddValidateWidget(pWidgetAcc); } else if (pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent) ->GetElementType() == XFA_Element::ExclGroup) { - pWidgetAcc->UpdateUIDisplay(); + pWidgetAcc->UpdateUIDisplay(m_pDoc->GetDocView(), nullptr); } return; } diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp index bf25b8bfb3..d6fd5be4ca 100644 --- a/xfa/fxfa/cxfa_fftextedit.cpp +++ b/xfa/fxfa/cxfa_fftextedit.cpp @@ -185,7 +185,7 @@ bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) { bool CXFA_FFTextEdit::CommitData() { WideString wsText = static_cast(m_pNormalWidget.get())->GetText(); if (m_pDataAcc->SetValue(XFA_VALUEPICTURE_Edit, wsText)) { - m_pDataAcc->UpdateUIDisplay(this); + m_pDataAcc->UpdateUIDisplay(GetDoc()->GetDocView(), this); return true; } ValidateNumberField(wsText); diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index 8851d269c6..8313e6074d 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -545,7 +545,7 @@ int32_t CXFA_WidgetAcc::ProcessCalculate() { if (GetRawValue() != EventParam.m_wsResult) { SetValue(XFA_VALUEPICTURE_Raw, EventParam.m_wsResult); - UpdateUIDisplay(); + UpdateUIDisplay(m_pDocView, nullptr); } return XFA_EVENTERROR_Success; } @@ -867,8 +867,9 @@ CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { return static_cast(pWidget->GetNext()); } -void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { - CXFA_FFWidget* pWidget = m_pDocView->GetWidgetForNode(m_pNode); +void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFDocView* docView, + CXFA_FFWidget* pExcept) { + CXFA_FFWidget* pWidget = docView->GetWidgetForNode(m_pNode); for (; pWidget; pWidget = GetNextWidget(pWidget)) { if (pWidget == pExcept || !pWidget->IsLoaded() || (GetUIType() != XFA_Element::CheckButton && pWidget->IsFocused())) { diff --git a/xfa/fxfa/cxfa_widgetacc.h b/xfa/fxfa/cxfa_widgetacc.h index 2736f59139..e2810571bc 100644 --- a/xfa/fxfa/cxfa_widgetacc.h +++ b/xfa/fxfa/cxfa_widgetacc.h @@ -99,7 +99,7 @@ class CXFA_WidgetAcc { const WideString& wsData); void SetImageImage(const RetainPtr& newImage); void SetImageEditImage(const RetainPtr& newImage); - void UpdateUIDisplay(CXFA_FFWidget* pExcept = nullptr); + void UpdateUIDisplay(CXFA_FFDocView* docView, CXFA_FFWidget* pExcept); CXFA_Node* GetDatasets(); RetainPtr GetFDEFont(); -- cgit v1.2.3