summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfdoc_unittest.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-14 16:59:10 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-14 16:59:10 -0700
commit3ba098595ae56b64eacc0c25ab76b89a4d78d920 (patch)
tree5c4db47295ea64cdf236c32ef7d5af5b8e7af232 /fpdfsdk/fpdfdoc_unittest.cpp
parent1d023881cd53485303c0fcc0b5878e700dc470fd (diff)
downloadpdfium-3ba098595ae56b64eacc0c25ab76b89a4d78d920.tar.xz
Update CPDF_IndirectObjectHolder APIs for unique objects.
Doing so highlights a few places where ownership is dubious. Add convenience functions to return an unowned reference to a newly-created indirect object. Review-Url: https://codereview.chromium.org/2419173002
Diffstat (limited to 'fpdfsdk/fpdfdoc_unittest.cpp')
-rw-r--r--fpdfsdk/fpdfdoc_unittest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index fc85404dba..40457ee447 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -80,8 +80,8 @@ class PDFDocTest : public testing::Test {
std::vector<DictObjInfo> info;
for (int i = 0; i < num; ++i) {
// Objects created will be released by the document.
- CPDF_Dictionary* obj = new CPDF_Dictionary();
- info.push_back({m_pIndirectObjs->AddIndirectObject(obj), obj});
+ CPDF_Dictionary* obj = m_pIndirectObjs->AddIndirectDictionary();
+ info.push_back({obj->GetObjNum(), obj});
}
return info;
}