diff options
author | Lei Zhang <thestig@chromium.org> | 2015-05-06 14:48:28 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-05-06 14:48:28 -0700 |
commit | 5734d862cb22eca6e9644ea7d1c096d70123434f (patch) | |
tree | 896e80b1809d3961375e0cdca6b78fbe4ec7d8f5 /core/src/fpdfapi/fpdf_font/fpdf_font.cpp | |
parent | 903e03a03ad4526252874d8ba15258e7c2955739 (diff) | |
download | pdfium-5734d862cb22eca6e9644ea7d1c096d70123434f.tar.xz |
Merge to XFA: Replace FX_NEW with new, remove tests from fpdfapi
Very few places where a change is required, but remove FX_NEW to show
they've been audited.
Review URL: https://codereview.chromium.org/1075953004
(cherry picked from commit 5c357a5d3d873be6b0ab01d7bec82f79d0a09f0e)
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1125183006
Diffstat (limited to 'core/src/fpdfapi/fpdf_font/fpdf_font.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_font/fpdf_font.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp index eace07ceb2..282d02263f 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp @@ -62,10 +62,8 @@ void CPDF_FontGlobals::Set(void* key, int index, CPDF_Font* pFont) ((CFX_StockFontArray*)value)->m_pStockFonts[index] = pFont; return; } - CFX_StockFontArray* pFonts = FX_NEW CFX_StockFontArray(); - if (pFonts) { - pFonts->m_pStockFonts[index] = pFont; - } + CFX_StockFontArray* pFonts = new CFX_StockFontArray(); + pFonts->m_pStockFonts[index] = pFont; m_pStockMap.SetAt(key, pFonts); } void CPDF_FontGlobals::Clear(void* key) @@ -363,7 +361,7 @@ void CPDF_Font::LoadUnicodeMap() if (pStream == NULL) { return; } - m_pToUnicodeMap = FX_NEW CPDF_ToUnicodeMap; + m_pToUnicodeMap = new CPDF_ToUnicodeMap; m_pToUnicodeMap->Load(pStream); } int CPDF_Font::GetStringWidth(FX_LPCSTR pString, int size) @@ -435,7 +433,7 @@ CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDic if (i < count) { CPDF_Dictionary* pFontDesc = pFontDict->GetDict(FX_BSTRC("FontDescriptor")); if (pFontDesc == NULL || !pFontDesc->KeyExist(FX_BSTRC("FontFile2"))) { - pFont = FX_NEW CPDF_CIDFont; + pFont = new CPDF_CIDFont; pFont->m_pFontDict = pFontDict; pFont->m_pDocument = pDoc; if (!pFont->Load()) { @@ -447,13 +445,13 @@ CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDic } #endif } - pFont = FX_NEW CPDF_TrueTypeFont; + pFont = new CPDF_TrueTypeFont; } else if (type == FX_BSTRC("Type3")) { - pFont = FX_NEW CPDF_Type3Font; + pFont = new CPDF_Type3Font; } else if (type == FX_BSTRC("Type0")) { - pFont = FX_NEW CPDF_CIDFont; + pFont = new CPDF_CIDFont; } else { - pFont = FX_NEW CPDF_Type1Font; + pFont = new CPDF_Type1Font; } pFont->m_pFontDict = pFontDict; pFont->m_pDocument = pDoc; @@ -1688,8 +1686,8 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level) if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) { return NULL; } - pChar = FX_NEW CPDF_Type3Char; - pChar->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, NULL); + pChar = new CPDF_Type3Char; + pChar->m_pForm = new CPDF_Form(m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, NULL); pChar->m_pForm->ParseContent(NULL, NULL, pChar, NULL, level + 1); FX_FLOAT scale = m_FontMatrix.GetXUnit(); pChar->m_Width = (FX_INT32)(pChar->m_Width * scale + 0.5f); |