Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: fpdfsdk/src/fpdfformfill.cpp

Issue 1398703009: Next round of XFA changes to match master (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: remove arg Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698