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

Side by Side Diff: fpdfsdk/fpdfformfill.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « fpdfsdk/fpdfeditpage.cpp ('k') | fpdfsdk/fpdfsave.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 options.m_AddFlags = flags >> 8; 132 options.m_AddFlags = flags >> 8;
133 options.m_pOCContext = new CPDF_OCContext(pPDFDoc, CPDF_OCContext::View); 133 options.m_pOCContext = new CPDF_OCContext(pPDFDoc, CPDF_OCContext::View);
134 134
135 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) 135 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage))
136 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); 136 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip);
137 #endif // PDF_ENABLE_XFA 137 #endif // PDF_ENABLE_XFA
138 138
139 pDevice->RestoreState(false); 139 pDevice->RestoreState(false);
140 delete options.m_pOCContext; 140 delete options.m_pOCContext;
141 #ifdef PDF_ENABLE_XFA 141 #ifdef PDF_ENABLE_XFA
142 options.m_pOCContext = NULL; 142 options.m_pOCContext = nullptr;
143 #endif // PDF_ENABLE_XFA 143 #endif // PDF_ENABLE_XFA
144 } 144 }
145 145
146 } // namespace 146 } // namespace
147 147
148 DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, 148 DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
149 FPDF_PAGE page, 149 FPDF_PAGE page,
150 double page_x, 150 double page_x,
151 double page_y) { 151 double page_y) {
152 if (!hHandle) 152 if (!hHandle)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 DLLEXPORT void STDCALL 259 DLLEXPORT void STDCALL
260 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { 260 FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) {
261 if (!hHandle) 261 if (!hHandle)
262 return; 262 return;
263 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; 263 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
264 #ifdef PDF_ENABLE_XFA 264 #ifdef PDF_ENABLE_XFA
265 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance(); 265 CPDFXFA_App* pApp = CPDFXFA_App::GetInstance();
266 pApp->RemoveFormFillEnv(pEnv); 266 pApp->RemoveFormFillEnv(pEnv);
267 #else // PDF_ENABLE_XFA 267 #else // PDF_ENABLE_XFA
268 if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) { 268 if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) {
269 pEnv->SetSDKDocument(NULL); 269 pEnv->SetSDKDocument(nullptr);
270 delete pSDKDoc; 270 delete pSDKDoc;
271 } 271 }
272 #endif // PDF_ENABLE_XFA 272 #endif // PDF_ENABLE_XFA
273 delete pEnv; 273 delete pEnv;
274 } 274 }
275 275
276 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, 276 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,
277 FPDF_PAGE page, 277 FPDF_PAGE page,
278 int modifier, 278 int modifier,
279 double page_x, 279 double page_x,
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 718 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
719 } 719 }
720 } else { 720 } else {
721 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 721 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
722 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 722 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
723 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 723 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
724 } 724 }
725 } 725 }
726 } 726 }
727 } 727 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfeditpage.cpp ('k') | fpdfsdk/fpdfsave.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698