summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_baannot.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-10-14 17:45:56 -0700
committerTom Sepez <tsepez@chromium.org>2016-10-14 17:45:56 -0700
commitc25a4219431c90a95233a08f25eecc921abbf3ed (patch)
treebd2ad923d527440785c19623fe2d19cc1a70a92d /fpdfsdk/cpdfsdk_baannot.cpp
parent62f367348ff8ff1e64c6f52c1ee5f77c3a89edc1 (diff)
downloadpdfium-c25a4219431c90a95233a08f25eecc921abbf3ed.tar.xz
Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920. TBR=thestig@chromium.org,weili@chromium.org Review URL: https://codereview.chromium.org/2424533003 .
Diffstat (limited to 'fpdfsdk/cpdfsdk_baannot.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_baannot.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index e704822e4d..72468e180f 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -316,9 +316,10 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType,
}
if (!pStream) {
+ pStream = new CPDF_Stream;
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
- pStream = pDoc->AddIndirectStream();
- pParentDict->SetReferenceFor(sAPType, pDoc, pStream);
+ pParentDict->SetReferenceFor(sAPType, pDoc,
+ pDoc->AddIndirectObject(pStream));
}
CPDF_Dictionary* pStreamDict = pStream->GetDict();
@@ -353,10 +354,8 @@ void CPDFSDK_BAAnnot::SetAction(const CPDF_Action& action) {
CPDF_Dictionary* pDict = action.GetDict();
if (pDict != m_pAnnot->GetAnnotDict()->GetDictFor("A")) {
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
-
- // TODO(tsepez): check |pDict| ownership.
- m_pAnnot->GetAnnotDict()->SetReferenceFor(
- "A", pDoc, pDoc->AddIndirectObject(UniqueDictionary(pDict)));
+ m_pAnnot->GetAnnotDict()->SetReferenceFor("A", pDoc,
+ pDoc->AddIndirectObject(pDict));
}
}