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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 months 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/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdftext/fpdf_text.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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fpdfapi/fpdf_render.h" 8 #include "../../../include/fpdfapi/fpdf_render.h"
9 #include "../../../include/fpdfapi/fpdf_pageobj.h" 9 #include "../../../include/fpdfapi/fpdf_pageobj.h"
10 #include "../fpdf_page/pageint.h" 10 #include "../fpdf_page/pageint.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 CPDF_Font* pFont, 524 CPDF_Font* pFont,
525 FX_FLOAT font_size); 525 FX_FLOAT font_size);
526 FXTEXT_CHARPOS* m_pCharPos; 526 FXTEXT_CHARPOS* m_pCharPos;
527 FX_DWORD m_nChars; 527 FX_DWORD m_nChars;
528 }; 528 };
529 FX_FLOAT _CIDTransformToFloat(uint8_t ch); 529 FX_FLOAT _CIDTransformToFloat(uint8_t ch);
530 CPDF_CharPosList::CPDF_CharPosList() { 530 CPDF_CharPosList::CPDF_CharPosList() {
531 m_pCharPos = NULL; 531 m_pCharPos = NULL;
532 } 532 }
533 CPDF_CharPosList::~CPDF_CharPosList() { 533 CPDF_CharPosList::~CPDF_CharPosList() {
534 if (m_pCharPos) { 534 FX_Free(m_pCharPos);
535 FX_Free(m_pCharPos);
536 }
537 } 535 }
538 void CPDF_CharPosList::Load(int nChars, 536 void CPDF_CharPosList::Load(int nChars,
539 FX_DWORD* pCharCodes, 537 FX_DWORD* pCharCodes,
540 FX_FLOAT* pCharPos, 538 FX_FLOAT* pCharPos,
541 CPDF_Font* pFont, 539 CPDF_Font* pFont,
542 FX_FLOAT FontSize) { 540 FX_FLOAT FontSize) {
543 m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars); 541 m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars);
544 m_nChars = 0; 542 m_nChars = 0;
545 CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); 543 CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
546 FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting(); 544 FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 ProcessPath(&path, pObj2Device); 789 ProcessPath(&path, pObj2Device);
792 } 790 }
793 } 791 }
794 CFX_PathData* CPDF_Font::LoadGlyphPath(FX_DWORD charcode, int dest_width) { 792 CFX_PathData* CPDF_Font::LoadGlyphPath(FX_DWORD charcode, int dest_width) {
795 int glyph_index = GlyphFromCharCode(charcode); 793 int glyph_index = GlyphFromCharCode(charcode);
796 if (m_Font.m_Face == NULL) { 794 if (m_Font.m_Face == NULL) {
797 return NULL; 795 return NULL;
798 } 796 }
799 return m_Font.LoadGlyphPath(glyph_index, dest_width); 797 return m_Font.LoadGlyphPath(glyph_index, dest_width);
800 } 798 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdftext/fpdf_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698