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

Unified Diff: fpdfsdk/cpdfsdk_widget.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/cpdfsdk_baannot.cpp ('k') | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_widget.cpp
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index cc2a7670398bf27f3c863233fef263f75bb6b585..15e81f88249ed1f43211f804ef13672e29a3ca81 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -1815,9 +1815,6 @@ CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const {
void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType,
CPDF_Stream* pImage) {
- CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
- ASSERT(pDoc);
-
CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictFor("AP");
CPDF_Stream* pStream = pAPDict->GetStreamFor(sAPType);
CPDF_Dictionary* pStreamDict = pStream->GetDict();
@@ -1829,13 +1826,14 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType,
sImageAlias = "IMG";
}
+ CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources");
if (!pStreamResList) {
- pStreamResList = new CPDF_Dictionary();
+ pStreamResList = new CPDF_Dictionary(pDoc->GetByteStringPool());
pStreamDict->SetFor("Resources", pStreamResList);
}
- CPDF_Dictionary* pXObject = new CPDF_Dictionary;
+ CPDF_Dictionary* pXObject = new CPDF_Dictionary(pDoc->GetByteStringPool());
pXObject->SetReferenceFor(sImageAlias, pDoc, pImage->GetObjNum());
pStreamResList->SetFor("XObject", pXObject);
}
« no previous file with comments | « fpdfsdk/cpdfsdk_baannot.cpp ('k') | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698