summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_transformpage.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-28 16:47:07 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-28 16:47:07 -0700
commit698c5716d005860360527e4cfe15b4a185589117 (patch)
tree7e82388a12f3de2b6fb179181d77b47d2c547df7 /fpdfsdk/fpdf_transformpage.cpp
parent4ba37c6f6964f6a24fc4b8b48bc82c02edb70370 (diff)
downloadpdfium-698c5716d005860360527e4cfe15b4a185589117.tar.xz
Use string pools in some dictionaries, names, and strings.
BUG=pdfium:597 Review-Url: https://codereview.chromium.org/2345063002
Diffstat (limited to 'fpdfsdk/fpdf_transformpage.cpp')
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 68007d3ca5..8841c96f23 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -125,15 +125,16 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
if (!pContentObj)
return FALSE;
- CPDF_Dictionary* pDic = new CPDF_Dictionary;
- CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, pDic);
- pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize());
CPDF_Document* pDoc = pPage->m_pDocument;
if (!pDoc)
return FALSE;
+
+ CPDF_Dictionary* pDic = new CPDF_Dictionary(pDoc->GetByteStringPool());
+ CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, pDic);
+ pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize());
pDoc->AddIndirectObject(pStream);
+ pDic = new CPDF_Dictionary(pDoc->GetByteStringPool());
- pDic = new CPDF_Dictionary;
CPDF_Stream* pEndStream = new CPDF_Stream(nullptr, 0, pDic);
pEndStream->SetData((const uint8_t*)" Q", 2);
pDoc->AddIndirectObject(pEndStream);
@@ -300,13 +301,13 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
strClip << "W* n\n";
}
}
- CPDF_Dictionary* pDic = new CPDF_Dictionary;
- CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, pDic);
- pStream->SetData(strClip.GetBuffer(), strClip.GetSize());
CPDF_Document* pDoc = pPage->m_pDocument;
if (!pDoc)
return;
+ CPDF_Dictionary* pDic = new CPDF_Dictionary(pDoc->GetByteStringPool());
+ CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, pDic);
+ pStream->SetData(strClip.GetBuffer(), strClip.GetSize());
pDoc->AddIndirectObject(pStream);
CPDF_Array* pContentArray = nullptr;