| 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/fpdfxfa/include/fpdfxfa_doc.h" | 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 return; | 496 return; |
| 497 | 497 |
| 498 CXFA_FFPageView* pPageView = hWidget->GetPageView(); | 498 CXFA_FFPageView* pPageView = hWidget->GetPageView(); |
| 499 if (!pPageView) | 499 if (!pPageView) |
| 500 return; | 500 return; |
| 501 | 501 |
| 502 CPDFXFA_Page* pXFAPage = GetPage(pPageView); | 502 CPDFXFA_Page* pXFAPage = GetPage(pPageView); |
| 503 if (!pXFAPage) | 503 if (!pXFAPage) |
| 504 return; | 504 return; |
| 505 | 505 |
| 506 m_pSDKDoc->GetPageView(pXFAPage)->AddAnnot(hWidget); | 506 m_pSDKDoc->GetPageView(pXFAPage, true)->AddAnnot(hWidget); |
| 507 } | 507 } |
| 508 | 508 |
| 509 void CPDFXFA_Document::WidgetPreRemove(CXFA_FFWidget* hWidget, | 509 void CPDFXFA_Document::WidgetPreRemove(CXFA_FFWidget* hWidget, |
| 510 CXFA_WidgetAcc* pWidgetData) { | 510 CXFA_WidgetAcc* pWidgetData) { |
| 511 if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget) | 511 if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget) |
| 512 return; | 512 return; |
| 513 | 513 |
| 514 CXFA_FFPageView* pPageView = hWidget->GetPageView(); | 514 CXFA_FFPageView* pPageView = hWidget->GetPageView(); |
| 515 if (!pPageView) | 515 if (!pPageView) |
| 516 return; | 516 return; |
| 517 | 517 |
| 518 CPDFXFA_Page* pXFAPage = GetPage(pPageView); | 518 CPDFXFA_Page* pXFAPage = GetPage(pPageView); |
| 519 if (!pXFAPage) | 519 if (!pXFAPage) |
| 520 return; | 520 return; |
| 521 | 521 |
| 522 CPDFSDK_PageView* pSdkPageView = m_pSDKDoc->GetPageView(pXFAPage); | 522 CPDFSDK_PageView* pSdkPageView = m_pSDKDoc->GetPageView(pXFAPage, true); |
| 523 if (CPDFSDK_Annot* pAnnot = pSdkPageView->GetAnnotByXFAWidget(hWidget)) | 523 if (CPDFSDK_Annot* pAnnot = pSdkPageView->GetAnnotByXFAWidget(hWidget)) |
| 524 pSdkPageView->DeleteAnnot(pAnnot); | 524 pSdkPageView->DeleteAnnot(pAnnot); |
| 525 } | 525 } |
| 526 | 526 |
| 527 FX_BOOL CPDFXFA_Document::RenderCustomWidget(CXFA_FFWidget* hWidget, | 527 FX_BOOL CPDFXFA_Document::RenderCustomWidget(CXFA_FFWidget* hWidget, |
| 528 CFX_Graphics* pGS, | 528 CFX_Graphics* pGS, |
| 529 CFX_Matrix* pMatrix, | 529 CFX_Matrix* pMatrix, |
| 530 const CFX_RectF& rtUI) { | 530 const CFX_RectF& rtUI) { |
| 531 return FALSE; | 531 return FALSE; |
| 532 } | 532 } |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 | 1275 |
| 1276 return m_pSDKDoc->GetEnv()->GetJSRuntime()->GetValueByName(szPropName, | 1276 return m_pSDKDoc->GetEnv()->GetJSRuntime()->GetValueByName(szPropName, |
| 1277 pValue); | 1277 pValue); |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 CPDF_Document* CPDFXFA_Document::OpenPDF(CXFA_FFDoc* hDoc, | 1280 CPDF_Document* CPDFXFA_Document::OpenPDF(CXFA_FFDoc* hDoc, |
| 1281 IFX_FileRead* pFile, | 1281 IFX_FileRead* pFile, |
| 1282 FX_BOOL bTakeOverFile) { | 1282 FX_BOOL bTakeOverFile) { |
| 1283 return nullptr; | 1283 return nullptr; |
| 1284 } | 1284 } |
| OLD | NEW |