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

Unified Diff: fpdfsdk/formfiller/cba_fontmap.cpp

Issue 2345063002: Use string pools in some dictionaries (Closed)
Patch Set: Remove default ctor 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
Index: fpdfsdk/formfiller/cba_fontmap.cpp
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index 8a981690f1cf637fa35404648f01e916ae2aba78..3b715d7332b205da6acfd1e1998f03e14be1d0a3 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -154,9 +154,8 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
return;
CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictFor("AP");
-
if (!pAPDict) {
- pAPDict = new CPDF_Dictionary;
+ pAPDict = new CPDF_Dictionary(m_pDocument);
m_pAnnotDict->SetFor("AP", pAPDict);
}
@@ -173,23 +172,22 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
}
CPDF_Dictionary* pStreamDict = pStream->GetDict();
-
if (!pStreamDict) {
- pStreamDict = new CPDF_Dictionary;
+ pStreamDict = new CPDF_Dictionary(m_pDocument);
pStream->InitStream(nullptr, 0, pStreamDict);
}
if (pStreamDict) {
CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources");
if (!pStreamResList) {
- pStreamResList = new CPDF_Dictionary();
+ pStreamResList = new CPDF_Dictionary(m_pDocument);
pStreamDict->SetFor("Resources", pStreamResList);
}
if (pStreamResList) {
CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictFor("Font");
if (!pStreamResFontList) {
- pStreamResFontList = new CPDF_Dictionary;
+ pStreamResFontList = new CPDF_Dictionary(m_pDocument);
int32_t objnum = m_pDocument->AddIndirectObject(pStreamResFontList);
pStreamResList->SetReferenceFor("Font", m_pDocument, objnum);
}

Powered by Google App Engine
This is Rietveld 408576698