summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-18 17:05:11 -0800
committerLei Zhang <thestig@chromium.org>2015-12-18 17:05:11 -0800
commit4880d1a168729d42be736293fb93b514802e4f12 (patch)
tree9cfe5aa73113301487dce8bcef5139fb7295536a /core/src/fpdfapi/fpdf_font
parentaedd4555ec1a80121f176586cb72180337e4ccd8 (diff)
downloadpdfium-4880d1a168729d42be736293fb93b514802e4f12.tar.xz
Merge to XFA: 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 . (cherry picked from commit d866ab0b44a571c884fdd8ba5a5319adaf607559) Review URL: https://codereview.chromium.org/1541563002 .
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;
}