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

Unified Diff: fpdfsdk/fpdf_transformpage.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 | « fpdfsdk/fpdf_flatten.cpp ('k') | fpdfsdk/fpdfdoc_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_transformpage.cpp
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 68007d3ca53430e39a5199bfc44d71d9acee65fd..8841c96f23b717670e3fdf41d10d2d4b3b4d7527 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;
« no previous file with comments | « fpdfsdk/fpdf_flatten.cpp ('k') | fpdfsdk/fpdfdoc_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698