| 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 "public/fpdf_formfill.h" | 7 #include "public/fpdf_formfill.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 CPDFSDK_FormFillEnvironment* pEnv = HandleToCPDFSDKEnvironment(hHandle); | 271 CPDFSDK_FormFillEnvironment* pEnv = HandleToCPDFSDKEnvironment(hHandle); |
| 272 | 272 |
| 273 #ifdef PDF_ENABLE_XFA | 273 #ifdef PDF_ENABLE_XFA |
| 274 CPDFXFA_App::GetInstance()->RemoveFormFillEnv(pEnv); | 274 CPDFXFA_App::GetInstance()->RemoveFormFillEnv(pEnv); |
| 275 | 275 |
| 276 // Reset the focused annotations and remove the SDK document from the | 276 // Reset the focused annotations and remove the SDK document from the |
| 277 // XFA document. | 277 // XFA document. |
| 278 if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) { | 278 if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) { |
| 279 pSDKDoc->ClearAllFocusedAnnots(); | 279 pSDKDoc->ClearAllFocusedAnnots(); |
| 280 pSDKDoc->GetXFADocument()->SetSDKDoc(nullptr); | 280 // If the document was closed first, it's possible the XFA document |
| 281 // is now a nullptr. |
| 282 if (pSDKDoc->GetXFADocument()) |
| 283 pSDKDoc->GetXFADocument()->SetSDKDoc(nullptr); |
| 281 } | 284 } |
| 282 #endif // PDF_ENABLE_XFA | 285 #endif // PDF_ENABLE_XFA |
| 283 | 286 |
| 284 delete pEnv; | 287 delete pEnv; |
| 285 } | 288 } |
| 286 | 289 |
| 287 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, | 290 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, |
| 288 FPDF_PAGE page, | 291 FPDF_PAGE page, |
| 289 int modifier, | 292 int modifier, |
| 290 double page_x, | 293 double page_x, |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); | 739 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); |
| 737 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 740 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
| 738 } | 741 } |
| 739 } else { | 742 } else { |
| 740 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 743 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
| 741 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 744 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
| 742 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 745 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
| 743 } | 746 } |
| 744 } | 747 } |
| 745 } | 748 } |
| OLD | NEW |