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

Side by Side Diff: core/src/fpdfapi/fpdf_font/fpdf_font.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 "font_int.h" 7 #include "font_int.h"
8 8
9 #include "core/src/fpdfapi/fpdf_page/pageint.h" 9 #include "core/src/fpdfapi/fpdf_page/pageint.h"
10 #include "core/include/fpdfapi/fpdf_module.h" 10 #include "core/include/fpdfapi/fpdf_module.h"
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 if (!maccode) { 1512 if (!maccode) {
1513 m_GlyphIndex[charcode] = 1513 m_GlyphIndex[charcode] =
1514 FXFT_Get_Name_Index(m_Font.GetFace(), (char*)name); 1514 FXFT_Get_Name_Index(m_Font.GetFace(), (char*)name);
1515 } else { 1515 } else {
1516 m_GlyphIndex[charcode] = 1516 m_GlyphIndex[charcode] =
1517 FXFT_Get_Char_Index(m_Font.GetFace(), maccode); 1517 FXFT_Get_Char_Index(m_Font.GetFace(), maccode);
1518 } 1518 }
1519 } 1519 }
1520 } 1520 }
1521 if ((m_GlyphIndex[charcode] == 0 || m_GlyphIndex[charcode] == 0xffff) && 1521 if ((m_GlyphIndex[charcode] == 0 || m_GlyphIndex[charcode] == 0xffff) &&
1522 name != NULL) { 1522 name) {
1523 if (name[0] == '.' && FXSYS_strcmp(name, ".notdef") == 0) { 1523 if (name[0] == '.' && FXSYS_strcmp(name, ".notdef") == 0) {
1524 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), 32); 1524 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), 32);
1525 } else { 1525 } else {
1526 m_GlyphIndex[charcode] = 1526 m_GlyphIndex[charcode] =
1527 FXFT_Get_Name_Index(m_Font.GetFace(), (char*)name); 1527 FXFT_Get_Name_Index(m_Font.GetFace(), (char*)name);
1528 if (m_GlyphIndex[charcode] == 0) { 1528 if (m_GlyphIndex[charcode] == 0) {
1529 if (bToUnicode) { 1529 if (bToUnicode) {
1530 CFX_WideString wsUnicode = UnicodeFromCharCode(charcode); 1530 CFX_WideString wsUnicode = UnicodeFromCharCode(charcode);
1531 if (!wsUnicode.IsEmpty()) { 1531 if (!wsUnicode.IsEmpty()) {
1532 m_GlyphIndex[charcode] = 1532 m_GlyphIndex[charcode] =
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 rect = pChar->m_BBox; 1762 rect = pChar->m_BBox;
1763 } 1763 }
1764 1764
1765 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) 1765 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm)
1766 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} 1766 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {}
1767 1767
1768 CPDF_Type3Char::~CPDF_Type3Char() { 1768 CPDF_Type3Char::~CPDF_Type3Char() {
1769 delete m_pForm; 1769 delete m_pForm;
1770 delete m_pBitmap; 1770 delete m_pBitmap;
1771 } 1771 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp ('k') | core/src/fpdfapi/fpdf_font/ttgsubtable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698