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

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

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: nits Created 5 years, 5 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/src/formfiller/FFL_TextField.cpp ('k') | fpdfsdk/src/fpdftext.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_transformpage.h" 7 #include "../../public/fpdf_transformpage.h"
8 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 9
10 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo ttom, float right, float top) 10 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo ttom, float right, float top)
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 pNewClipPath->GetModify(); 204 pNewClipPath->GetModify();
205 CPDF_Path Path; 205 CPDF_Path Path;
206 Path.GetModify(); 206 Path.GetModify();
207 Path.AppendRect(left, bottom, right, top); 207 Path.AppendRect(left, bottom, right, top);
208 pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE); 208 pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
209 return pNewClipPath; 209 return pNewClipPath;
210 } 210 }
211 211
212 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) 212 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath)
213 { 213 {
214 » if(clipPath) 214 delete (CPDF_ClipPath*)clipPath;
215 » » delete (CPDF_ClipPath*)clipPath;
216 } 215 }
217 216
218 void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) 217 void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path)
219 { 218 {
220 const CFX_PathData* pPathData = path; 219 const CFX_PathData* pPathData = path;
221 if (pPathData == NULL) return; 220 if (pPathData == NULL) return;
222 221
223 FX_PATHPOINT* pPoints = pPathData->GetPoints(); 222 FX_PATHPOINT* pPoints = pPathData->GetPoints();
224 223
225 if (path.IsRect()) { 224 if (path.IsRect()) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 { 311 {
313 pContentArray = new CPDF_Array(); 312 pContentArray = new CPDF_Array();
314 pContentArray->AddReference(pDoc,pStream->GetObj Num()); 313 pContentArray->AddReference(pDoc,pStream->GetObj Num());
315 pContentArray->AddReference(pDoc,pDirectObj->Get ObjNum()); 314 pContentArray->AddReference(pDoc,pDirectObj->Get ObjNum());
316 pPageDic->SetAtReference("Contents", pDoc, pDoc- >AddIndirectObject(pContentArray)); 315 pPageDic->SetAtReference("Contents", pDoc, pDoc- >AddIndirectObject(pContentArray));
317 } 316 }
318 } 317 }
319 } 318 }
320 } 319 }
321 320
OLDNEW
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_TextField.cpp ('k') | fpdfsdk/src/fpdftext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698