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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits 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
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 "pageint.h" 7 #include "pageint.h"
8 8
9 #include "core/include/fpdfapi/fpdf_page.h" 9 #include "core/include/fpdfapi/fpdf_page.h"
10 10
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 CPDF_Pattern::~CPDF_Pattern() {} 38 CPDF_Pattern::~CPDF_Pattern() {}
39 CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, 39 CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc,
40 CPDF_Object* pPatternObj, 40 CPDF_Object* pPatternObj,
41 const CFX_Matrix* parentMatrix) 41 const CFX_Matrix* parentMatrix)
42 : CPDF_Pattern(parentMatrix) { 42 : CPDF_Pattern(parentMatrix) {
43 m_PatternType = PATTERN_TILING; 43 m_PatternType = PATTERN_TILING;
44 m_pPatternObj = pPatternObj; 44 m_pPatternObj = pPatternObj;
45 m_pDocument = pDoc; 45 m_pDocument = pDoc;
46 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); 46 CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
47 ASSERT(pDict != NULL); 47 ASSERT(pDict);
48 m_Pattern2Form = pDict->GetMatrix("Matrix"); 48 m_Pattern2Form = pDict->GetMatrix("Matrix");
49 m_bColored = pDict->GetInteger("PaintType") == 1; 49 m_bColored = pDict->GetInteger("PaintType") == 1;
50 if (parentMatrix) { 50 if (parentMatrix) {
51 m_Pattern2Form.Concat(*parentMatrix); 51 m_Pattern2Form.Concat(*parentMatrix);
52 } 52 }
53 m_pForm = NULL; 53 m_pForm = NULL;
54 } 54 }
55 CPDF_TilingPattern::~CPDF_TilingPattern() { 55 CPDF_TilingPattern::~CPDF_TilingPattern() {
56 delete m_pForm; 56 delete m_pForm;
57 m_pForm = NULL; 57 m_pForm = NULL;
(...skipping 23 matching lines...) Expand all
81 CPDF_Object* pPatternObj, 81 CPDF_Object* pPatternObj,
82 FX_BOOL bShading, 82 FX_BOOL bShading,
83 const CFX_Matrix* parentMatrix) 83 const CFX_Matrix* parentMatrix)
84 : CPDF_Pattern(parentMatrix) { 84 : CPDF_Pattern(parentMatrix) {
85 m_PatternType = PATTERN_SHADING; 85 m_PatternType = PATTERN_SHADING;
86 m_pPatternObj = bShading ? NULL : pPatternObj; 86 m_pPatternObj = bShading ? NULL : pPatternObj;
87 m_pDocument = pDoc; 87 m_pDocument = pDoc;
88 m_bShadingObj = bShading; 88 m_bShadingObj = bShading;
89 if (!bShading) { 89 if (!bShading) {
90 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); 90 CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
91 ASSERT(pDict != NULL); 91 ASSERT(pDict);
92 m_Pattern2Form = pDict->GetMatrix("Matrix"); 92 m_Pattern2Form = pDict->GetMatrix("Matrix");
93 m_pShadingObj = pDict->GetElementValue("Shading"); 93 m_pShadingObj = pDict->GetElementValue("Shading");
94 if (parentMatrix) { 94 if (parentMatrix) {
95 m_Pattern2Form.Concat(*parentMatrix); 95 m_Pattern2Form.Concat(*parentMatrix);
96 } 96 }
97 } else { 97 } else {
98 m_pShadingObj = pPatternObj; 98 m_pShadingObj = pPatternObj;
99 } 99 }
100 m_ShadingType = kInvalidShading; 100 m_ShadingType = kInvalidShading;
101 m_pCS = NULL; 101 m_pCS = NULL;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 } 325 }
326 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * 326 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits *
327 color_count); 327 color_count);
328 if (bGouraud) 328 if (bGouraud)
329 stream.m_BitStream.ByteAlign(); 329 stream.m_BitStream.ByteAlign();
330 } 330 }
331 rect.Transform(pMatrix); 331 rect.Transform(pMatrix);
332 return rect; 332 return rect;
333 } 333 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698