summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-18 16:26:45 -0800
committerLei Zhang <thestig@chromium.org>2015-12-18 16:26:45 -0800
commitd866ab0b44a571c884fdd8ba5a5319adaf607559 (patch)
treece18ed89550cf563dbdf2e421f8ff08bc6526f27 /core/src/fpdfapi/fpdf_font
parent20c8a9a66ea710b96493c9048fb65753e68b48fc (diff)
downloadpdfium-d866ab0b44a571c884fdd8ba5a5319adaf607559.tar.xz
Get rid of a few CPDF_Object Create() methods and just use new instead.
R=ochang@chromium.org Review URL: https://codereview.chromium.org/1540693002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 3170b55e20..7b3f8055fb 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -390,7 +390,7 @@ CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc,
if (pFont) {
return pFont;
}
- CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
+ CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName("Type", "Font");
pDict->SetAtName("Subtype", "Type1");
pDict->SetAtName("BaseFont", fontname);
@@ -1391,28 +1391,29 @@ CPDF_Object* CPDF_FontEncoding::Realize() {
}
if (predefined) {
if (predefined == PDFFONT_ENCODING_WINANSI) {
- return CPDF_Name::Create("WinAnsiEncoding");
+ return new CPDF_Name("WinAnsiEncoding");
}
if (predefined == PDFFONT_ENCODING_MACROMAN) {
- return CPDF_Name::Create("MacRomanEncoding");
+ return new CPDF_Name("MacRomanEncoding");
}
if (predefined == PDFFONT_ENCODING_MACEXPERT) {
- return CPDF_Name::Create("MacExpertEncoding");
+ return new CPDF_Name("MacExpertEncoding");
}
return NULL;
}
- CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
- pDict->SetAtName("BaseEncoding", "WinAnsiEncoding");
const FX_WORD* pStandard =
PDF_UnicodesForPredefinedCharSet(PDFFONT_ENCODING_WINANSI);
- CPDF_Array* pDiff = CPDF_Array::Create();
+ CPDF_Array* pDiff = new CPDF_Array;
for (int i = 0; i < 256; i++) {
if (pStandard[i] == m_Unicodes[i]) {
continue;
}
- pDiff->Add(CPDF_Number::Create(i));
- pDiff->Add(CPDF_Name::Create(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
+ pDiff->Add(new CPDF_Number(i));
+ pDiff->Add(new CPDF_Name(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
}
+
+ CPDF_Dictionary* pDict = new CPDF_Dictionary;
+ pDict->SetAtName("BaseEncoding", "WinAnsiEncoding");
pDict->SetAt("Differences", pDiff);
return pDict;
}