summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffnotify.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-22 18:43:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-22 18:43:17 +0000
commited4038bc335385b7e341d8de5c2bec8db5dcdcb6 (patch)
tree86af694f9185c0be181c778cf45ede8f57791534 /xfa/fxfa/cxfa_ffnotify.cpp
parentd7d584df24fda9c9a28330959cc28f94dc0294e2 (diff)
downloadpdfium-ed4038bc335385b7e341d8de5c2bec8db5dcdcb6.tar.xz
Move the UI elements from CXFA_WidgetAcc to CXFA_Node
This CL moves the methods and members related to the UI nodes from the CXFA_WidgetAcc class to the CXFA_Node class. Change-Id: I1fdc5173787141065f1e607bbfefa3b22af738b4 Reviewed-on: https://pdfium-review.googlesource.com/23290 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.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp
index 301a8ecf04..7d9f1c6fa5 100644
--- a/xfa/fxfa/cxfa_ffnotify.cpp
+++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -63,18 +63,17 @@ void CXFA_FFNotify::OnPageEvent(CXFA_ContainerLayoutItem* pSender,
pDocView->OnPageEvent(pSender, dwEvent);
}
-void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetAcc* pSender,
+void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_Node* pSender,
const wchar_t* pLabel,
const wchar_t* pValue,
int32_t iIndex) {
if (pSender->GetUIType() != XFA_Element::ChoiceList)
return;
- CXFA_FFWidget* pWidget =
- m_pDoc->GetDocView()->GetWidgetForNode(pSender->GetNode());
- for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) {
+ CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender);
+ for (; pWidget; pWidget = pSender->GetWidgetAcc()->GetNextWidget(pWidget)) {
if (pWidget->IsLoaded()) {
- if (pSender->IsListBox())
+ if (pSender->GetWidgetAcc()->IsListBox())
ToListBox(pWidget)->InsertItem(pLabel, iIndex);
else
ToComboBox(pWidget)->InsertItem(pLabel, iIndex);
@@ -82,16 +81,15 @@ void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetAcc* pSender,
}
}
-void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_WidgetAcc* pSender,
+void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_Node* pSender,
int32_t iIndex) {
if (pSender->GetUIType() != XFA_Element::ChoiceList)
return;
- CXFA_FFWidget* pWidget =
- m_pDoc->GetDocView()->GetWidgetForNode(pSender->GetNode());
- for (; pWidget; pWidget = pSender->GetNextWidget(pWidget)) {
+ CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender);
+ for (; pWidget; pWidget = pSender->GetWidgetAcc()->GetNextWidget(pWidget)) {
if (pWidget->IsLoaded()) {
- if (pSender->IsListBox())
+ if (pSender->GetWidgetAcc()->IsListBox())
ToListBox(pWidget)->DeleteItem(iIndex);
else
ToComboBox(pWidget)->DeleteItem(iIndex);
@@ -121,7 +119,7 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
return new CXFA_ContentLayoutItem(pNode);
CXFA_FFWidget* pWidget;
- switch (pNode->GetWidgetAcc()->GetUIType()) {
+ switch (pNode->GetUIType()) {
case XFA_Element::Barcode:
pWidget = new CXFA_FFBarcode(pNode);
break;
@@ -272,8 +270,7 @@ CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) {
}
void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) {
- if (hWidget->GetNode()->GetWidgetAcc()->GetUIType() !=
- XFA_Element::ChoiceList)
+ if (hWidget->GetNode()->GetUIType() != XFA_Element::ChoiceList)
return;
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();