summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
commit96660d6f382204339d6b1aadc3913303d436e252 (patch)
treeb5f84756e1a89251831cebc05b9d4e1f6cb2027b /core/src/fpdfapi/fpdf_font
parentd983b09c3ae29a97cba8e9ec9c6351545f6087ee (diff)
downloadpdfium-96660d6f382204339d6b1aadc3913303d436e252.tar.xz
Merge to XFA: Get rid of most instance of 'foo != NULL'
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index b515d90a7f..4a71382da4 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -1519,7 +1519,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap() {
}
}
if ((m_GlyphIndex[charcode] == 0 || m_GlyphIndex[charcode] == 0xffff) &&
- name != NULL) {
+ name) {
if (name[0] == '.' && FXSYS_strcmp(name, ".notdef") == 0) {
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.GetFace(), 32);
} else {
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index e3c9965654..605d25fd57 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -277,10 +277,9 @@ class CFX_CTTGSUBTable {
TLookup()
: LookupType(0), LookupFlag(0), SubTableCount(0), SubTable(NULL) {}
~TLookup() {
- if (SubTableCount > 0 && SubTable != NULL) {
- for (int i = 0; i < SubTableCount; i++) {
+ if (SubTable) {
+ for (int i = 0; i < SubTableCount; ++i)
delete SubTable[i];
- }
delete[] SubTable;
}
}