summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.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/cpdfsdk_widget.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/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index cc2a767039..15e81f8824 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);
}