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_ffapp.h" | |
10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 9 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
11 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" | 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" |
12 #include "xfa/fxfa/app/xfa_ffchoicelist.h" | 11 #include "xfa/fxfa/app/xfa_ffchoicelist.h" |
13 #include "xfa/fxfa/app/xfa_ffdoc.h" | |
14 #include "xfa/fxfa/app/xfa_ffdocview.h" | |
15 #include "xfa/fxfa/app/xfa_ffdraw.h" | 12 #include "xfa/fxfa/app/xfa_ffdraw.h" |
16 #include "xfa/fxfa/app/xfa_ffexclgroup.h" | 13 #include "xfa/fxfa/app/xfa_ffexclgroup.h" |
17 #include "xfa/fxfa/app/xfa_fffield.h" | 14 #include "xfa/fxfa/app/xfa_fffield.h" |
18 #include "xfa/fxfa/app/xfa_ffimage.h" | 15 #include "xfa/fxfa/app/xfa_ffimage.h" |
19 #include "xfa/fxfa/app/xfa_ffimageedit.h" | 16 #include "xfa/fxfa/app/xfa_ffimageedit.h" |
20 #include "xfa/fxfa/app/xfa_ffpageview.h" | |
21 #include "xfa/fxfa/app/xfa_ffpath.h" | 17 #include "xfa/fxfa/app/xfa_ffpath.h" |
22 #include "xfa/fxfa/app/xfa_ffpushbutton.h" | 18 #include "xfa/fxfa/app/xfa_ffpushbutton.h" |
23 #include "xfa/fxfa/app/xfa_ffsignature.h" | 19 #include "xfa/fxfa/app/xfa_ffsignature.h" |
24 #include "xfa/fxfa/app/xfa_ffsubform.h" | 20 #include "xfa/fxfa/app/xfa_ffsubform.h" |
25 #include "xfa/fxfa/app/xfa_fftext.h" | 21 #include "xfa/fxfa/app/xfa_fftext.h" |
26 #include "xfa/fxfa/app/xfa_fftextedit.h" | 22 #include "xfa/fxfa/app/xfa_fftextedit.h" |
27 #include "xfa/fxfa/app/xfa_ffwidget.h" | 23 #include "xfa/fxfa/app/xfa_ffwidget.h" |
28 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" | 24 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" |
29 #include "xfa/fxfa/app/xfa_ffwidgethandler.h" | |
30 #include "xfa/fxfa/app/xfa_fwladapter.h" | 25 #include "xfa/fxfa/app/xfa_fwladapter.h" |
31 #include "xfa/fxfa/app/xfa_textlayout.h" | 26 #include "xfa/fxfa/app/xfa_textlayout.h" |
| 27 #include "xfa/include/fxfa/xfa_ffapp.h" |
| 28 #include "xfa/include/fxfa/xfa_ffdoc.h" |
| 29 #include "xfa/include/fxfa/xfa_ffdocview.h" |
| 30 #include "xfa/include/fxfa/xfa_ffpageview.h" |
| 31 #include "xfa/include/fxfa/xfa_ffwidgethandler.h" |
32 | 32 |
33 static void XFA_FFDeleteWidgetAcc(void* pData) { | 33 static void XFA_FFDeleteWidgetAcc(void* pData) { |
34 delete static_cast<CXFA_WidgetAcc*>(pData); | 34 delete static_cast<CXFA_WidgetAcc*>(pData); |
35 } | 35 } |
| 36 |
36 static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteWidgetAcc = { | 37 static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteWidgetAcc = { |
37 XFA_FFDeleteWidgetAcc, NULL}; | 38 XFA_FFDeleteWidgetAcc, nullptr}; |
| 39 |
38 CXFA_FFNotify::CXFA_FFNotify(CXFA_FFDoc* pDoc) : m_pDoc(pDoc) {} | 40 CXFA_FFNotify::CXFA_FFNotify(CXFA_FFDoc* pDoc) : m_pDoc(pDoc) {} |
39 CXFA_FFNotify::~CXFA_FFNotify() {} | 41 CXFA_FFNotify::~CXFA_FFNotify() {} |
40 void CXFA_FFNotify::OnPageEvent(IXFA_LayoutPage* pSender, | 42 void CXFA_FFNotify::OnPageEvent(CXFA_ContainerLayoutItem* pSender, |
41 XFA_PAGEEVENT eEvent, | 43 XFA_PAGEEVENT eEvent, |
42 void* pParam) { | 44 void* pParam) { |
43 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pSender->GetLayout()); | 45 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pSender->GetLayout()); |
44 if (!pDocView) { | 46 if (!pDocView) { |
45 return; | 47 return; |
46 } | 48 } |
47 pDocView->OnPageEvent(pSender, eEvent, (int32_t)(uintptr_t)pParam); | 49 pDocView->OnPageEvent(pSender, eEvent, (int32_t)(uintptr_t)pParam); |
48 } | 50 } |
49 void CXFA_FFNotify::OnNodeEvent(CXFA_Node* pSender, | 51 void CXFA_FFNotify::OnNodeEvent(CXFA_Node* pSender, |
50 XFA_NODEEVENT eEvent, | 52 XFA_NODEEVENT eEvent, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( | 141 pWidgetAcc->GetDoc()->GetDocProvider()->WidgetEvent( |
140 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, | 142 pWidget, pWidgetAcc, XFA_WIDGETEVENT_ListItemRemoved, pParam, |
141 pAdditional); | 143 pAdditional); |
142 } | 144 } |
143 pWidget = pWidgetAcc->GetNextWidget(pWidget); | 145 pWidget = pWidgetAcc->GetNextWidget(pWidget); |
144 } | 146 } |
145 } break; | 147 } break; |
146 } | 148 } |
147 } | 149 } |
148 CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) { | 150 CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) { |
149 IXFA_DocLayout* pLayout = m_pDoc->GetXFADoc()->GetDocLayout(); | 151 CXFA_LayoutProcessor* pLayout = m_pDoc->GetXFADoc()->GetDocLayout(); |
150 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); | 152 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
151 XFA_ELEMENT eType = pNode->GetClassID(); | 153 XFA_ELEMENT eType = pNode->GetClassID(); |
152 if (eType == XFA_ELEMENT_PageArea) { | 154 if (eType == XFA_ELEMENT_PageArea) { |
153 return new CXFA_FFPageView(pDocView, pNode); | 155 return new CXFA_FFPageView(pDocView, pNode); |
154 } | 156 } |
155 if (eType == XFA_ELEMENT_ContentArea) { | 157 if (eType == XFA_ELEMENT_ContentArea) { |
156 return new CXFA_ContainerLayoutItem(pNode); | 158 return new CXFA_ContainerLayoutItem(pNode); |
157 } | 159 } |
158 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); | 160 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); |
159 if (!pAcc) { | 161 if (!pAcc) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 default: | 226 default: |
225 pWidget = NULL; | 227 pWidget = NULL; |
226 break; | 228 break; |
227 } | 229 } |
228 if (!pWidget) { | 230 if (!pWidget) { |
229 return NULL; | 231 return NULL; |
230 } | 232 } |
231 pWidget->SetDocView(pDocView); | 233 pWidget->SetDocView(pDocView); |
232 return pWidget; | 234 return pWidget; |
233 } | 235 } |
234 void CXFA_FFNotify::OnLayoutEvent(IXFA_DocLayout* pLayout, | 236 void CXFA_FFNotify::OnLayoutEvent(CXFA_LayoutProcessor* pLayout, |
235 CXFA_LayoutItem* pSender, | 237 CXFA_LayoutItem* pSender, |
236 XFA_LAYOUTEVENT eEvent, | 238 XFA_LAYOUTEVENT eEvent, |
237 void* pParam, | 239 void* pParam, |
238 void* pParam2) { | 240 void* pParam2) { |
239 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); | 241 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout); |
240 if (!pDocView || !XFA_GetWidgetFromLayoutItem(pSender)) { | 242 if (!pDocView || !XFA_GetWidgetFromLayoutItem(pSender)) { |
241 return; | 243 return; |
242 } | 244 } |
243 switch (eEvent) { | 245 switch (eEvent) { |
244 case XFA_LAYOUTEVENT_ItemAdded: | 246 case XFA_LAYOUTEVENT_ItemAdded: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 return; | 316 return; |
315 } | 317 } |
316 CXFA_WidgetAcc* pWidgetAcc = | 318 CXFA_WidgetAcc* pWidgetAcc = |
317 static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); | 319 static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); |
318 if (!pWidgetAcc) { | 320 if (!pWidgetAcc) { |
319 return; | 321 return; |
320 } | 322 } |
321 pDocView->AddCalculateWidgetAcc(pWidgetAcc); | 323 pDocView->AddCalculateWidgetAcc(pWidgetAcc); |
322 pDocView->AddValidateWidget(pWidgetAcc); | 324 pDocView->AddValidateWidget(pWidgetAcc); |
323 } | 325 } |
324 IXFA_Doc* CXFA_FFNotify::GetHDOC() { | 326 CXFA_FFDoc* CXFA_FFNotify::GetHDOC() { |
325 return m_pDoc; | 327 return m_pDoc; |
326 } | 328 } |
327 IXFA_DocProvider* CXFA_FFNotify::GetDocProvider() { | 329 IXFA_DocProvider* CXFA_FFNotify::GetDocProvider() { |
328 return m_pDoc->GetDocProvider(); | 330 return m_pDoc->GetDocProvider(); |
329 } | 331 } |
330 IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { | 332 IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { |
331 return m_pDoc->GetApp()->GetAppProvider(); | 333 return m_pDoc->GetApp()->GetAppProvider(); |
332 } | 334 } |
333 IXFA_WidgetHandler* CXFA_FFNotify::GetWidgetHandler() { | 335 CXFA_FFWidgetHandler* CXFA_FFNotify::GetWidgetHandler() { |
334 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 336 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
335 return pDocView ? pDocView->GetWidgetHandler() : NULL; | 337 return pDocView ? pDocView->GetWidgetHandler() : NULL; |
336 } | 338 } |
337 IXFA_Widget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { | 339 CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { |
338 return XFA_GetWidgetFromLayoutItem(pLayoutItem); | 340 return XFA_GetWidgetFromLayoutItem(pLayoutItem); |
339 } | 341 } |
340 void CXFA_FFNotify::OpenDropDownList(IXFA_Widget* hWidget) { | 342 void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) { |
341 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(hWidget); | 343 if (hWidget->GetDataAcc()->GetUIType() != XFA_ELEMENT_ChoiceList) { |
342 if (pWidget->GetDataAcc()->GetUIType() != XFA_ELEMENT_ChoiceList) { | |
343 return; | 344 return; |
344 } | 345 } |
345 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 346 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
346 pDocView->LockUpdate(); | 347 pDocView->LockUpdate(); |
347 static_cast<CXFA_FFComboBox*>(pWidget)->OpenDropDownList(); | 348 static_cast<CXFA_FFComboBox*>(hWidget)->OpenDropDownList(); |
348 pDocView->UnlockUpdate(); | 349 pDocView->UnlockUpdate(); |
349 pDocView->UpdateDocView(); | 350 pDocView->UpdateDocView(); |
350 } | 351 } |
351 CFX_WideString CXFA_FFNotify::GetCurrentDateTime() { | 352 CFX_WideString CXFA_FFNotify::GetCurrentDateTime() { |
352 CFX_Unitime dataTime; | 353 CFX_Unitime dataTime; |
353 dataTime.Now(); | 354 dataTime.Now(); |
354 CFX_WideString wsDateTime; | 355 CFX_WideString wsDateTime; |
355 wsDateTime.Format(L"%d%02d%02dT%02d%02d%02d", dataTime.GetYear(), | 356 wsDateTime.Format(L"%d%02d%02dT%02d%02d%02d", dataTime.GetYear(), |
356 dataTime.GetMonth(), dataTime.GetDay(), dataTime.GetHour(), | 357 dataTime.GetMonth(), dataTime.GetDay(), dataTime.GetHour(), |
357 dataTime.GetMinute(), dataTime.GetSecond()); | 358 dataTime.GetMinute(), dataTime.GetSecond()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 pNode ? static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()) : nullptr; | 400 pNode ? static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()) : nullptr; |
400 pDocView->SetFocusWidgetAcc(pAcc); | 401 pDocView->SetFocusWidgetAcc(pAcc); |
401 } | 402 } |
402 void CXFA_FFNotify::OnNodeReady(CXFA_Node* pNode) { | 403 void CXFA_FFNotify::OnNodeReady(CXFA_Node* pNode) { |
403 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 404 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
404 if (!pDocView) { | 405 if (!pDocView) { |
405 return; | 406 return; |
406 } | 407 } |
407 XFA_ELEMENT iType = pNode->GetClassID(); | 408 XFA_ELEMENT iType = pNode->GetClassID(); |
408 if (XFA_IsCreateWidget(iType)) { | 409 if (XFA_IsCreateWidget(iType)) { |
409 CXFA_WidgetAcc* pAcc = | 410 CXFA_WidgetAcc* pAcc = new CXFA_WidgetAcc(pDocView, pNode); |
410 new CXFA_WidgetAcc(pDocView, static_cast<CXFA_Node*>(pNode)); | |
411 pNode->SetObject(XFA_ATTRIBUTE_WidgetData, pAcc, &gs_XFADeleteWidgetAcc); | 411 pNode->SetObject(XFA_ATTRIBUTE_WidgetData, pAcc, &gs_XFADeleteWidgetAcc); |
412 return; | 412 return; |
413 } | 413 } |
414 switch (iType) { | 414 switch (iType) { |
415 case XFA_ELEMENT_BindItems: | 415 case XFA_ELEMENT_BindItems: |
416 pDocView->m_bindItems.Add(pNode); | 416 pDocView->m_bindItems.Add(pNode); |
417 break; | 417 break; |
418 case XFA_ELEMENT_Validate: { | 418 case XFA_ELEMENT_Validate: { |
419 pNode->SetFlag(XFA_NODEFLAG_NeedsInitApp, TRUE, FALSE); | 419 pNode->SetFlag(XFA_NODEFLAG_NeedsInitApp, TRUE, FALSE); |
420 } break; | 420 } break; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 if (CXFA_FFDocView* pDocView = m_pDoc->GetDocView()) { | 561 if (CXFA_FFDocView* pDocView = m_pDoc->GetDocView()) { |
562 FX_BOOL bLayoutReady = | 562 FX_BOOL bLayoutReady = |
563 !(pDocView->m_bInLayoutStatus) && | 563 !(pDocView->m_bInLayoutStatus) && |
564 (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End); | 564 (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End); |
565 if (bLayoutReady) { | 565 if (bLayoutReady) { |
566 m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc); | 566 m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc); |
567 } | 567 } |
568 } | 568 } |
569 } | 569 } |
570 void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, | 570 void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, |
571 IXFA_DocLayout* pLayout, | 571 CXFA_LayoutProcessor* pLayout, |
572 CXFA_LayoutItem* pSender, | 572 CXFA_LayoutItem* pSender, |
573 void* pParam, | 573 void* pParam, |
574 void* pParam2) { | 574 void* pParam2) { |
575 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 575 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); |
576 int32_t iPageIdx = (int32_t)(uintptr_t)pParam; | 576 int32_t iPageIdx = (int32_t)(uintptr_t)pParam; |
577 IXFA_PageView* pNewPageView = pDocView->GetPageView(iPageIdx); | 577 CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx); |
578 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam2; | 578 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam2; |
579 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | 579 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | |
580 XFA_WIDGETSTATUS_Printable; | 580 XFA_WIDGETSTATUS_Printable; |
581 pWidget->ModifyStatus(dwStatus, dwFilter); | 581 pWidget->ModifyStatus(dwStatus, dwFilter); |
582 IXFA_PageView* pPrePageView = pWidget->GetPageView(); | 582 CXFA_FFPageView* pPrePageView = pWidget->GetPageView(); |
583 if (pPrePageView != pNewPageView || | 583 if (pPrePageView != pNewPageView || |
584 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == | 584 (dwStatus & (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) == |
585 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { | 585 (XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable)) { |
586 pWidget->SetPageView(pNewPageView); | 586 pWidget->SetPageView(pNewPageView); |
587 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 587 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
588 XFA_WIDGETEVENT_PostAdded, | 588 XFA_WIDGETEVENT_PostAdded, |
589 pNewPageView, pPrePageView); | 589 pNewPageView, pPrePageView); |
590 } | 590 } |
591 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || | 591 if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End || |
592 !(dwStatus & XFA_WIDGETSTATUS_Visible)) { | 592 !(dwStatus & XFA_WIDGETSTATUS_Visible)) { |
593 return; | 593 return; |
594 } | 594 } |
595 if (pWidget->IsLoaded()) { | 595 if (pWidget->IsLoaded()) { |
596 CFX_RectF rtOld; | 596 CFX_RectF rtOld; |
597 pWidget->GetWidgetRect(rtOld); | 597 pWidget->GetWidgetRect(rtOld); |
598 if (rtOld != pWidget->ReCacheWidgetRect()) | 598 if (rtOld != pWidget->ReCacheWidgetRect()) |
599 pWidget->PerformLayout(); | 599 pWidget->PerformLayout(); |
600 } else { | 600 } else { |
601 pWidget->LoadWidget(); | 601 pWidget->LoadWidget(); |
602 } | 602 } |
603 pWidget->AddInvalidateRect(nullptr); | 603 pWidget->AddInvalidateRect(nullptr); |
604 } | 604 } |
605 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView, | 605 void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView, |
606 IXFA_DocLayout* pLayout, | 606 CXFA_LayoutProcessor* pLayout, |
607 CXFA_LayoutItem* pSender, | 607 CXFA_LayoutItem* pSender, |
608 void* pParam, | 608 void* pParam, |
609 void* pParam2) { | 609 void* pParam2) { |
610 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 610 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); |
611 pDocView->DeleteLayoutItem(pWidget); | 611 pDocView->DeleteLayoutItem(pWidget); |
612 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), | 612 m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(), |
613 XFA_WIDGETEVENT_PreRemoved, nullptr, | 613 XFA_WIDGETEVENT_PreRemoved, nullptr, |
614 pWidget->GetPageView()); | 614 pWidget->GetPageView()); |
615 pWidget->AddInvalidateRect(nullptr); | 615 pWidget->AddInvalidateRect(nullptr); |
616 } | 616 } |
617 void CXFA_FFNotify::OnLayoutItemRectChanged(CXFA_FFDocView* pDocView, | 617 void CXFA_FFNotify::OnLayoutItemRectChanged(CXFA_FFDocView* pDocView, |
618 IXFA_DocLayout* pLayout, | 618 CXFA_LayoutProcessor* pLayout, |
619 CXFA_LayoutItem* pSender, | 619 CXFA_LayoutItem* pSender, |
620 void* pParam, | 620 void* pParam, |
621 void* pParam2) {} | 621 void* pParam2) {} |
622 void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, | 622 void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, |
623 IXFA_DocLayout* pLayout, | 623 CXFA_LayoutProcessor* pLayout, |
624 CXFA_LayoutItem* pSender, | 624 CXFA_LayoutItem* pSender, |
625 void* pParam, | 625 void* pParam, |
626 void* pParam2) { | 626 void* pParam2) { |
627 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); | 627 CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender); |
628 if (!pWidget) { | 628 if (!pWidget) { |
629 return; | 629 return; |
630 } | 630 } |
631 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam; | 631 uint32_t dwStatus = (uint32_t)(uintptr_t)pParam; |
632 if (dwStatus == 0) { | 632 if (dwStatus == 0) { |
633 CXFA_LayoutItem* pPreItem = pSender->GetPrev(); | 633 CXFA_LayoutItem* pPreItem = pSender->GetPrev(); |
634 if (pPreItem) { | 634 if (pPreItem) { |
635 CXFA_FFWidget* pPreWidget = static_cast<CXFA_FFWidget*>(pPreItem); | 635 CXFA_FFWidget* pPreWidget = static_cast<CXFA_FFWidget*>(pPreItem); |
636 if (pPreWidget) { | 636 if (pPreWidget) { |
637 dwStatus = pPreWidget->GetStatus(); | 637 dwStatus = pPreWidget->GetStatus(); |
638 } | 638 } |
639 } | 639 } |
640 } | 640 } |
641 uint32_t dwOldStatus = pWidget->GetStatus(); | 641 uint32_t dwOldStatus = pWidget->GetStatus(); |
642 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | | 642 uint32_t dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | |
643 XFA_WIDGETSTATUS_Printable; | 643 XFA_WIDGETSTATUS_Printable; |
644 if ((dwOldStatus & dwFilter) == dwStatus) { | 644 if ((dwOldStatus & dwFilter) == dwStatus) { |
645 return; | 645 return; |
646 } | 646 } |
647 pWidget->ModifyStatus(dwStatus, dwFilter); | 647 pWidget->ModifyStatus(dwStatus, dwFilter); |
648 } | 648 } |
OLD | NEW |