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 #include "../../public/fpdfview.h" | 8 #include "../../public/fpdfview.h" |
| 9 #include "../../third_party/base/nonstd_unique_ptr.h" |
9 #include "../include/fsdk_define.h" | 10 #include "../include/fsdk_define.h" |
| 11 #include "../include/fsdk_mgr.h" |
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 12 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
11 #include "../include/fsdk_mgr.h" | |
12 #include "../include/fpdfxfa/fpdfxfa_page.h" | 13 #include "../include/fpdfxfa/fpdfxfa_page.h" |
13 #include "../include/fpdfxfa/fpdfxfa_app.h" | 14 #include "../include/fpdfxfa/fpdfxfa_app.h" |
14 | 15 |
15 #include "../include/javascript/IJavaScript.h" | 16 #include "../include/javascript/IJavaScript.h" |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) { | 20 CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) { |
20 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; | 21 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
21 return pEnv ? pEnv->GetSDKDocument() : nullptr; | 22 return pEnv ? pEnv->GetSDKDocument() : nullptr; |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 options.m_ForeColor = 0; | 315 options.m_ForeColor = 0; |
315 options.m_BackColor = 0xffffff; | 316 options.m_BackColor = 0xffffff; |
316 } | 317 } |
317 options.m_AddFlags = flags >> 8; | 318 options.m_AddFlags = flags >> 8; |
318 options.m_pOCContext = new CPDF_OCContext(pPDFDoc); | 319 options.m_pOCContext = new CPDF_OCContext(pPDFDoc); |
319 | 320 |
320 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDFXFA_Page*)page)) | 321 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDFXFA_Page*)page)) |
321 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, &clip); | 322 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, &clip); |
322 | 323 |
323 pDevice->RestoreState(); | 324 pDevice->RestoreState(); |
324 | |
325 delete options.m_pOCContext; | 325 delete options.m_pOCContext; |
326 options.m_pOCContext = NULL; | 326 options.m_pOCContext = NULL; |
327 } | 327 } |
328 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, | 328 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, |
329 FPDF_WIDGET hWidget) { | 329 FPDF_WIDGET hWidget) { |
330 if (NULL == hWidget || NULL == document) | 330 if (NULL == hWidget || NULL == document) |
331 return; | 331 return; |
332 | 332 |
333 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 333 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
334 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 334 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 675 } |
676 } else { | 676 } else { |
677 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); | 677 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); |
678 if (bExistCAAction) { | 678 if (bExistCAAction) { |
679 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 679 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
680 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 680 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
681 } | 681 } |
682 } | 682 } |
683 } | 683 } |
684 } | 684 } |
OLD | NEW |