diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-23 21:17:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-23 21:17:43 +0000 |
commit | 414cc9c9676b01587010ec5475d495eef6e05ba3 (patch) | |
tree | c4474fdd1cd945a16eb70cb0cb24b074e2010f22 /xfa/fxfa/cxfa_ffnotify.cpp | |
parent | 9b85f4ba6fdd86c488498003a2db5854d4ece036 (diff) | |
download | pdfium-414cc9c9676b01587010ec5475d495eef6e05ba3.tar.xz |
Remove GetWidgetAcc calls
This CL removes the calls to CXFA_Node::GetWidgetAcc() as they
redundantly return the node they were called upon.
Change-Id: I46e66cf98137a1dee7cd3fa8bc7d379eb97fded5
Reviewed-on: https://pdfium-review.googlesource.com/23630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffnotify.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffnotify.cpp | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index 91d1a65997..3fd06a18be 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -71,9 +71,9 @@ void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_Node* pSender, return; CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender); - for (; pWidget; pWidget = pSender->GetWidgetAcc()->GetNextWidget(pWidget)) { + for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) { - if (pSender->GetWidgetAcc()->IsListBox()) + if (pSender->IsListBox()) ToListBox(pWidget)->InsertItem(pLabel, iIndex); else ToComboBox(pWidget)->InsertItem(pLabel, iIndex); @@ -87,9 +87,9 @@ void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_Node* pSender, return; CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender); - for (; pWidget; pWidget = pSender->GetWidgetAcc()->GetNextWidget(pWidget)) { + for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) { - if (pSender->GetWidgetAcc()->IsListBox()) + if (pSender->IsListBox()) ToListBox(pWidget)->DeleteItem(iIndex); else ToComboBox(pWidget)->DeleteItem(iIndex); @@ -130,7 +130,7 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem( pWidget = new CXFA_FFCheckButton(pNode); break; case XFA_Element::ChoiceList: { - if (pNode->GetWidgetAcc()->IsListBox()) + if (pNode->IsListBox()) pWidget = new CXFA_FFListBox(pNode); else pWidget = new CXFA_FFComboBox(pNode); @@ -193,19 +193,7 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem( void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, float& fCalcWidth, float& fCalcHeight) { - if (!pItem->GetWidgetAcc()) - return; - - pItem->GetWidgetAcc()->StartWidgetLayout(m_pDoc.Get(), fCalcWidth, - fCalcHeight); -} - -bool CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, - int32_t iBlockIndex, - float& fCalcHeightPos) { - return pItem->GetWidgetAcc() && - pItem->GetWidgetAcc()->FindSplitPos(m_pDoc->GetDocView(), iBlockIndex, - fCalcHeightPos); + pItem->StartWidgetLayout(m_pDoc.Get(), fCalcWidth, fCalcHeight); } bool CXFA_FFNotify::RunScript(CXFA_Script* script, CXFA_Node* item) { @@ -237,8 +225,6 @@ void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) return; - if (!pNode->GetWidgetAcc()) - return; pDocView->AddCalculateNode(pNode); pDocView->AddValidateNode(pNode); @@ -360,11 +346,9 @@ void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, XFA_Attribute eAttr) { return; if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) return; - if (!pSender->GetWidgetAcc()) - return; CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender); - for (; pWidget; pWidget = pSender->GetWidgetAcc()->GetNextWidget(pWidget)) { + for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) pWidget->AddInvalidateRect(); } @@ -386,15 +370,11 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, XFA_Element eType = pParentNode->GetElementType(); bool bIsContainerNode = pParentNode->IsContainerNode(); - if (!pWidgetNode->GetWidgetAcc()) - return; - bool bUpdateProperty = false; pDocView->SetChangeMark(); switch (eType) { case XFA_Element::Caption: { - CXFA_TextLayout* pCapOut = - pWidgetNode->GetWidgetAcc()->GetCaptionTextLayout(); + CXFA_TextLayout* pCapOut = pWidgetNode->GetCaptionTextLayout(); if (!pCapOut) return; @@ -415,22 +395,19 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, pDocView->AddCalculateNodeNotify(pSender); if (eType == XFA_Element::Value || bIsContainerNode) { if (bIsContainerNode) { - pWidgetNode->GetWidgetAcc()->UpdateUIDisplay(m_pDoc->GetDocView(), - nullptr); + pWidgetNode->UpdateUIDisplay(m_pDoc->GetDocView(), nullptr); pDocView->AddCalculateNode(pWidgetNode); pDocView->AddValidateNode(pWidgetNode); } else if (pWidgetNode->GetParent()->GetElementType() == XFA_Element::ExclGroup) { - pWidgetNode->GetWidgetAcc()->UpdateUIDisplay(m_pDoc->GetDocView(), - nullptr); + pWidgetNode->UpdateUIDisplay(m_pDoc->GetDocView(), nullptr); } return; } } CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pWidgetNode); - for (; pWidget; - pWidget = pWidgetNode->GetWidgetAcc()->GetNextWidget(pWidget)) { + for (; pWidget; pWidget = pWidgetNode->GetNextWidget(pWidget)) { if (!pWidget->IsLoaded()) continue; |