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

Side by Side Diff: core/src/fpdfdoc/doc_ap.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
« no previous file with comments | « core/src/fpdfdoc/doc_annot.cpp ('k') | core/src/fpdfdoc/doc_basic.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 "core/include/fpdfdoc/fpdf_ap.h" 7 #include "core/include/fpdfdoc/fpdf_ap.h"
8 #include "core/include/fpdfdoc/fpdf_doc.h" 8 #include "core/include/fpdfdoc/fpdf_doc.h"
9 #include "core/include/fpdfdoc/fpdf_vt.h" 9 #include "core/include/fpdfdoc/fpdf_vt.h"
10 #include "doc_utils.h" 10 #include "doc_utils.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 case 1: 116 case 1:
117 if (!m_pSysFont) { 117 if (!m_pSysFont) {
118 GetAnnotSysPDFFont(m_pDocument, m_pResDict, m_pSysFont, 118 GetAnnotSysPDFFont(m_pDocument, m_pResDict, m_pSysFont,
119 m_sSysFontAlias); 119 m_sSysFontAlias);
120 } 120 }
121 return m_sSysFontAlias; 121 return m_sSysFontAlias;
122 } 122 }
123 return ""; 123 return "";
124 } 124 }
125 CPVT_Provider::CPVT_Provider(IPVT_FontMap* pFontMap) : m_pFontMap(pFontMap) { 125 CPVT_Provider::CPVT_Provider(IPVT_FontMap* pFontMap) : m_pFontMap(pFontMap) {
126 ASSERT(m_pFontMap != NULL); 126 ASSERT(m_pFontMap);
127 } 127 }
128 CPVT_Provider::~CPVT_Provider() {} 128 CPVT_Provider::~CPVT_Provider() {}
129 int32_t CPVT_Provider::GetCharWidth(int32_t nFontIndex, 129 int32_t CPVT_Provider::GetCharWidth(int32_t nFontIndex,
130 FX_WORD word, 130 FX_WORD word,
131 int32_t nWordStyle) { 131 int32_t nWordStyle) {
132 if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) { 132 if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
133 FX_DWORD charcode = pPDFFont->CharCodeFromUnicode(word); 133 FX_DWORD charcode = pPDFFont->CharCodeFromUnicode(word);
134 if (charcode != CPDF_Font::kInvalidCharCode) { 134 if (charcode != CPDF_Font::kInvalidCharCode) {
135 return pPDFFont->GetCharWidthF(charcode); 135 return pPDFFont->GetCharWidthF(charcode);
136 } 136 }
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 << "\n"; 925 << "\n";
926 break; 926 break;
927 case CT_CMYK: 927 case CT_CMYK:
928 sColorStream << color.fColor1 << " " << color.fColor2 << " " 928 sColorStream << color.fColor1 << " " << color.fColor2 << " "
929 << color.fColor3 << " " << color.fColor4 << " " 929 << color.fColor3 << " " << color.fColor4 << " "
930 << (bFillOrStroke ? "k" : "K") << "\n"; 930 << (bFillOrStroke ? "k" : "K") << "\n";
931 break; 931 break;
932 } 932 }
933 return sColorStream.GetByteString(); 933 return sColorStream.GetByteString();
934 } 934 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_annot.cpp ('k') | core/src/fpdfdoc/doc_basic.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698