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

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

Issue 2345063002: Use string pools in some dictionaries (Closed)
Patch Set: windows compile Created 4 years, 3 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/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp b/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
index 29587927bc55694001c6c78f3c651ed4e793672f..d0e5f16aeaee3505ddf473c0336c61353564dfc6 100644
--- a/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
@@ -1670,7 +1670,7 @@ FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const {
0;
}
-CPDF_Object* CPDF_FontEncoding::Realize() {
+CPDF_Object* CPDF_FontEncoding::Realize(CFX_WeakPtr<CFX_ByteStringPool> pPool) {
int predefined = 0;
for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS;
cs++) {
@@ -1689,13 +1689,13 @@ CPDF_Object* CPDF_FontEncoding::Realize() {
}
if (predefined) {
if (predefined == PDFFONT_ENCODING_WINANSI) {
- return new CPDF_Name("WinAnsiEncoding");
+ return new CPDF_Name(pPool->Intern("WinAnsiEncoding"));
}
if (predefined == PDFFONT_ENCODING_MACROMAN) {
- return new CPDF_Name("MacRomanEncoding");
+ return new CPDF_Name(pPool->Intern("MacRomanEncoding"));
}
if (predefined == PDFFONT_ENCODING_MACEXPERT) {
- return new CPDF_Name("MacExpertEncoding");
+ return new CPDF_Name(pPool->Intern("MacExpertEncoding"));
}
return nullptr;
}
@@ -1710,7 +1710,7 @@ CPDF_Object* CPDF_FontEncoding::Realize() {
pDiff->Add(new CPDF_Name(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
}
- CPDF_Dictionary* pDict = new CPDF_Dictionary;
+ CPDF_Dictionary* pDict = new CPDF_Dictionary(pPool);
pDict->SetNameFor("BaseEncoding", "WinAnsiEncoding");
pDict->SetFor("Differences", pDiff);
return pDict;
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698