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 "fpdfsdk/include/fsdk_define.h" | 7 #include "fpdfsdk/include/fsdk_define.h" |
8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" | 8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" |
9 #include "fpdfsdk/include/fsdk_mgr.h" | 9 #include "fpdfsdk/include/fsdk_mgr.h" |
10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" | 10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 return pEnv->FFI_PopupMenu(pPage, hWidget, menuFlag, ptPopup, NULL); | 470 return pEnv->FFI_PopupMenu(pPage, hWidget, menuFlag, ptPopup, NULL); |
471 } | 471 } |
472 | 472 |
473 void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView, | 473 void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView, |
474 FX_DWORD dwFlags) { | 474 FX_DWORD dwFlags) { |
475 if (!pPageView || (dwFlags != XFA_PAGEVIEWEVENT_PostAdded && | 475 if (!pPageView || (dwFlags != XFA_PAGEVIEWEVENT_PostAdded && |
476 dwFlags != XFA_PAGEVIEWEVENT_PostRemoved)) { | 476 dwFlags != XFA_PAGEVIEWEVENT_PostRemoved)) { |
477 return; | 477 return; |
478 } | 478 } |
479 CPDFXFA_Page* pPage = nullptr; | 479 CPDFXFA_Page* pPage = nullptr; |
| 480 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); |
480 if (dwFlags == XFA_PAGEVIEWEVENT_PostAdded) { | 481 if (dwFlags == XFA_PAGEVIEWEVENT_PostAdded) { |
481 pPage = GetPage(pPageView->GetPageViewIndex()); | 482 int nPageIndex = pPageView->GetPageViewIndex(); |
| 483 pPage = GetPage(nPageIndex); |
482 if (pPage) | 484 if (pPage) |
483 pPage->SetXFAPageView(pPageView); | 485 pPage->SetXFAPageView(pPageView); |
| 486 pEnv->FFI_PageEvent(nPageIndex, dwFlags); |
484 return; | 487 return; |
485 } | 488 } |
486 pPage = GetPage(pPageView); | 489 pPage = GetPage(pPageView); |
487 if (!pPage) | 490 if (!pPage) |
488 return; | 491 return; |
489 pPage->SetXFAPageView(nullptr); | 492 pEnv->FFI_PageEvent(pPage->GetPageIndex(), dwFlags); |
490 m_pSDKDoc->GetPageView(pPage)->ClearFXAnnots(); | 493 m_pSDKDoc->GetPageView(pPage)->ClearFXAnnots(); |
| 494 pPage->Release(); |
491 } | 495 } |
492 | 496 |
493 void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, | 497 void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, |
494 CXFA_WidgetAcc* pWidgetData, | 498 CXFA_WidgetAcc* pWidgetData, |
495 FX_DWORD dwEvent, | 499 FX_DWORD dwEvent, |
496 void* pParam, | 500 void* pParam, |
497 void* pAdditional) { | 501 void* pAdditional) { |
498 if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget) | 502 if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget) |
499 return; | 503 return; |
500 | 504 |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 } | 1260 } |
1257 | 1261 |
1258 return _GetHValueByName(szPropName, hValue, | 1262 return _GetHValueByName(szPropName, hValue, |
1259 m_pSDKDoc->GetEnv()->GetJSRuntime()); | 1263 m_pSDKDoc->GetEnv()->GetJSRuntime()); |
1260 } | 1264 } |
1261 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, | 1265 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, |
1262 FXJSE_HVALUE hValue, | 1266 FXJSE_HVALUE hValue, |
1263 IJS_Runtime* runTime) { | 1267 IJS_Runtime* runTime) { |
1264 return runTime->GetHValueByName(utf8Name, hValue); | 1268 return runTime->GetHValueByName(utf8Name, hValue); |
1265 } | 1269 } |
OLD | NEW |