From 698c5716d005860360527e4cfe15b4a185589117 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 28 Sep 2016 16:47:07 -0700 Subject: Use string pools in some dictionaries, names, and strings. BUG=pdfium:597 Review-Url: https://codereview.chromium.org/2345063002 --- core/fpdfdoc/cpdf_interform.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'core/fpdfdoc/cpdf_interform.cpp') diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index d2a842262e..29063f534b 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) { -- cgit v1.2.3