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

Unified Diff: core/src/fpdfapi/fpdf_font/fpdf_font.cpp

Issue 1134003007: Merge to XFA: Remove FX_NEW_VECTOR() macros. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_memory.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_font/fpdf_font.cpp
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 66d7d4f0268418cbef3c8f5642cb152c637bba4e..80dd1df803e3e477760c125edc0df7da9a1b4704 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -786,7 +786,7 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_
if (pDiffs == NULL) {
return;
}
- FX_NEW_VECTOR(pCharNames, CFX_ByteString, 256);
+ pCharNames = new CFX_ByteString[256];
FX_DWORD cur_code = 0;
for (FX_DWORD i = 0; i < pDiffs->GetCount(); i ++) {
CPDF_Object* pElement = pDiffs->GetElementValue(i);
@@ -828,9 +828,7 @@ CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype)
}
CPDF_SimpleFont::~CPDF_SimpleFont()
{
- if (m_pCharNames) {
- FX_DELETE_VECTOR(m_pCharNames, CFX_ByteString, 256);
- }
+ delete[] m_pCharNames;
}
int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
{
@@ -971,10 +969,8 @@ FX_BOOL CPDF_SimpleFont::LoadCommon()
CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, m_pFontFile != NULL, m_Font.IsTTFont());
LoadGlyphMap();
- if (m_pCharNames) {
- FX_DELETE_VECTOR(m_pCharNames, CFX_ByteString, 256);
- m_pCharNames = NULL;
- }
+ delete[] m_pCharNames;
+ m_pCharNames = NULL;
if (m_Font.m_Face == NULL) {
return TRUE;
}
« no previous file with comments | « core/include/fxcrt/fx_memory.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698