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

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

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years 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/fpdf_sysfontinfo.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 8
9 #include "fpdfsdk/include/fsdk_define.h" 9 #include "fpdfsdk/include/fsdk_define.h"
10 10
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 DLLEXPORT void STDCALL 189 DLLEXPORT void STDCALL
190 FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, 190 FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,
191 double a, 191 double a,
192 double b, 192 double b,
193 double c, 193 double c,
194 double d, 194 double d,
195 double e, 195 double e,
196 double f) { 196 double f) {
197 CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object; 197 CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
198 if (pPageObj == NULL) 198 if (!pPageObj)
199 return; 199 return;
200 CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d, 200 CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
201 (FX_FLOAT)e, (FX_FLOAT)f); 201 (FX_FLOAT)e, (FX_FLOAT)f);
202 202
203 // Special treatment to shading object, because the ClipPath for shading 203 // Special treatment to shading object, because the ClipPath for shading
204 // object is already transformed. 204 // object is already transformed.
205 if (pPageObj->m_Type != PDFPAGE_SHADING) 205 if (pPageObj->m_Type != PDFPAGE_SHADING)
206 pPageObj->TransformClipPath(matrix); 206 pPageObj->TransformClipPath(matrix);
207 pPageObj->TransformGeneralState(matrix); 207 pPageObj->TransformGeneralState(matrix);
208 } 208 }
(...skipping 10 matching lines...) Expand all
219 pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE); 219 pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
220 return pNewClipPath; 220 return pNewClipPath;
221 } 221 }
222 222
223 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) { 223 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) {
224 delete (CPDF_ClipPath*)clipPath; 224 delete (CPDF_ClipPath*)clipPath;
225 } 225 }
226 226
227 void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) { 227 void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) {
228 const CFX_PathData* pPathData = path; 228 const CFX_PathData* pPathData = path;
229 if (pPathData == NULL) 229 if (!pPathData)
230 return; 230 return;
231 231
232 FX_PATHPOINT* pPoints = pPathData->GetPoints(); 232 FX_PATHPOINT* pPoints = pPathData->GetPoints();
233 233
234 if (path.IsRect()) { 234 if (path.IsRect()) {
235 buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " " 235 buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " "
236 << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " " 236 << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " "
237 << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n"; 237 << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n";
238 return; 238 return;
239 } 239 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 } else if (pDirectObj->IsStream()) { 316 } else if (pDirectObj->IsStream()) {
317 pContentArray = new CPDF_Array(); 317 pContentArray = new CPDF_Array();
318 pContentArray->AddReference(pDoc, pStream->GetObjNum()); 318 pContentArray->AddReference(pDoc, pStream->GetObjNum());
319 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); 319 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum());
320 pPageDic->SetAtReference("Contents", pDoc, 320 pPageDic->SetAtReference("Contents", pDoc,
321 pDoc->AddIndirectObject(pContentArray)); 321 pDoc->AddIndirectObject(pContentArray));
322 } 322 }
323 } 323 }
324 } 324 }
325 } 325 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdf_sysfontinfo.cpp ('k') | fpdfsdk/src/fpdftext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698