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

Unified Diff: core/fpdfdoc/cpdf_interform.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/fpdfdoc/cpdf_formfield_unittest.cpp ('k') | core/fpdfdoc/cpvt_generateap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_interform.cpp
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index d2a842262eabafe645a9735a20c12128c2040fb3..29063f534bb2b123b5a95b9d988585ebd3ee05f3 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -58,7 +58,7 @@ void InitDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) {
return;
if (!pFormDict) {
- pFormDict = new CPDF_Dictionary;
+ pFormDict = new CPDF_Dictionary(pDocument->GetByteStringPool());
pDocument->GetRoot()->SetReferenceFor(
"AcroForm", pDocument, pDocument->AddIndirectObject(pFormDict));
}
@@ -259,12 +259,12 @@ void AddFont(CPDF_Dictionary*& pFormDict,
CPDF_Dictionary* pDR = pFormDict->GetDictFor("DR");
if (!pDR) {
- pDR = new CPDF_Dictionary;
+ pDR = new CPDF_Dictionary(pDocument->GetByteStringPool());
pFormDict->SetFor("DR", pDR);
}
CPDF_Dictionary* pFonts = pDR->GetDictFor("Font");
if (!pFonts) {
- pFonts = new CPDF_Dictionary;
+ pFonts = new CPDF_Dictionary(pDocument->GetByteStringPool());
pDR->SetFor("Font", pFonts);
}
if (csNameTag.IsEmpty())
@@ -1212,7 +1212,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
pMainDict->SetStringFor("F", CFX_ByteString::FromUnicode(wsFilePath));
pMainDict->SetStringFor("UF", PDF_EncodeText(wsFilePath));
} else {
- CPDF_FileSpec filespec;
+ CPDF_FileSpec filespec(pDoc->GetByteStringPool());
filespec.SetFileName(pdf_path);
pMainDict->SetFor("F", filespec.GetObj());
}
@@ -1235,7 +1235,8 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
continue;
CFX_WideString fullname = FPDF_GetFullName(pField->GetFieldDict());
- CPDF_Dictionary* pFieldDict = new CPDF_Dictionary;
+ CPDF_Dictionary* pFieldDict =
+ new CPDF_Dictionary(pDoc->GetByteStringPool());
pFieldDict->SetFor("T", new CPDF_String(fullname));
if (pField->GetType() == CPDF_FormField::CheckBox ||
pField->GetType() == CPDF_FormField::RadioButton) {
« no previous file with comments | « core/fpdfdoc/cpdf_formfield_unittest.cpp ('k') | core/fpdfdoc/cpvt_generateap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698