OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/app/xfa_ffnotify.h" | 7 #include "xfa/fxfa/app/xfa_ffnotify.h" |
8 | 8 |
9 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 9 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" | 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetData* pSender, | 50 void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetData* pSender, |
51 const FX_WCHAR* pLabel, | 51 const FX_WCHAR* pLabel, |
52 const FX_WCHAR* pValue, | 52 const FX_WCHAR* pValue, |
53 int32_t iIndex) { | 53 int32_t iIndex) { |
54 CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender); | 54 CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender); |
55 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) | 55 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) |
56 return; | 56 return; |
57 | 57 |
58 CXFA_FFWidget* pWidget = nullptr; | 58 CXFA_FFWidget* pWidget = nullptr; |
59 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { | 59 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { |
60 if (pWidget->IsLoaded()) { | 60 if (pWidget->IsLoaded()) { |
61 if (pWidgetAcc->IsListBox()) { | 61 if (pWidgetAcc->IsListBox()) { |
62 static_cast<CXFA_FFListBox*>(pWidget)->InsertItem(pLabel, iIndex); | 62 static_cast<CXFA_FFListBox*>(pWidget)->InsertItem(pLabel, iIndex); |
63 } else { | 63 } else { |
64 static_cast<CXFA_FFComboBox*>(pWidget)->InsertItem(pLabel, iIndex); | 64 static_cast<CXFA_FFComboBox*>(pWidget)->InsertItem(pLabel, iIndex); |
65 } | 65 } |
66 } | 66 } |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_WidgetData* pSender, | 70 void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_WidgetData* pSender, |
71 int32_t iIndex) { | 71 int32_t iIndex) { |
72 CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender); | 72 CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender); |
73 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) | 73 if (pWidgetAcc->GetUIType() != XFA_ELEMENT_ChoiceList) |
74 return; | 74 return; |
75 | 75 |
76 CXFA_FFWidget* pWidget = nullptr; | 76 CXFA_FFWidget* pWidget = nullptr; |
77 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { | 77 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { |
78 if (pWidget->IsLoaded()) { | 78 if (pWidget->IsLoaded()) { |
79 if (pWidgetAcc->IsListBox()) { | 79 if (pWidgetAcc->IsListBox()) { |
80 static_cast<CXFA_FFListBox*>(pWidget)->DeleteItem(iIndex); | 80 static_cast<CXFA_FFListBox*>(pWidget)->DeleteItem(iIndex); |
81 } else { | 81 } else { |
82 static_cast<CXFA_FFComboBox*>(pWidget)->DeleteItem(iIndex); | 82 static_cast<CXFA_FFComboBox*>(pWidget)->DeleteItem(iIndex); |
83 } | 83 } |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 353 |
354 if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) | 354 if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) |
355 return; | 355 return; |
356 | 356 |
357 CXFA_WidgetAcc* pWidgetAcc = | 357 CXFA_WidgetAcc* pWidgetAcc = |
358 static_cast<CXFA_WidgetAcc*>(pSender->GetWidgetData()); | 358 static_cast<CXFA_WidgetAcc*>(pSender->GetWidgetData()); |
359 if (!pWidgetAcc) | 359 if (!pWidgetAcc) |
360 return; | 360 return; |
361 | 361 |
362 CXFA_FFWidget* pWidget = nullptr; | 362 CXFA_FFWidget* pWidget = nullptr; |
363 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { | 363 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { |
364 if (pWidget->IsLoaded()) | 364 if (pWidget->IsLoaded()) |
365 pWidget->AddInvalidateRect(); | 365 pWidget->AddInvalidateRect(); |
366 } | 366 } |
367 } | 367 } |
368 | 368 |
369 void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, | 369 void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, |
370 XFA_ATTRIBUTE eAttr, | 370 XFA_ATTRIBUTE eAttr, |
371 CXFA_Node* pParentNode, | 371 CXFA_Node* pParentNode, |
372 CXFA_Node* pWidgetNode) { | 372 CXFA_Node* pWidgetNode) { |
373 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 373 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 pDocView->AddCalculateWidgetAcc(pWidgetAcc); | 415 pDocView->AddCalculateWidgetAcc(pWidgetAcc); |
416 pDocView->AddValidateWidget(pWidgetAcc); | 416 pDocView->AddValidateWidget(pWidgetAcc); |
417 } else if (pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent)->GetClassID() == | 417 } else if (pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent)->GetClassID() == |
418 XFA_ELEMENT_ExclGroup) { | 418 XFA_ELEMENT_ExclGroup) { |
419 pWidgetAcc->UpdateUIDisplay(); | 419 pWidgetAcc->UpdateUIDisplay(); |
420 } | 420 } |
421 return; | 421 return; |
422 } | 422 } |
423 } | 423 } |
424 CXFA_FFWidget* pWidget = nullptr; | 424 CXFA_FFWidget* pWidget = nullptr; |
425 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { | 425 while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { |
426 if (!pWidget->IsLoaded()) | 426 if (!pWidget->IsLoaded()) |
427 continue; | 427 continue; |
428 | 428 |
429 if (bUpdateProperty) | 429 if (bUpdateProperty) |
430 pWidget->UpdateWidgetProperty(); | 430 pWidget->UpdateWidgetProperty(); |
431 pWidget->PerformLayout(); | 431 pWidget->PerformLayout(); |
432 pWidget->AddInvalidateRect(); | 432 pWidget->AddInvalidateRect(); |
433 } | 433 } |
434 } | 434 } |
435 | 435 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 return; | 505 return; |
506 | 506 |
507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); | 507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
508 if (!pWidget) | 508 if (!pWidget) |
509 return; | 509 return; |
510 | 510 |
511 pDocView->DeleteLayoutItem(pWidget); | 511 pDocView->DeleteLayoutItem(pWidget); |
512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); | 512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); |
513 pWidget->AddInvalidateRect(nullptr); | 513 pWidget->AddInvalidateRect(nullptr); |
514 } | 514 } |
OLD | NEW |