summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfdoc_unittest.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-21 19:10:19 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-21 19:10:19 -0700
commitbb577af2f17467a55c04fbff21a8f0ec1016601a (patch)
tree5a5321b1aff1bcc6ee6dc19928aa729a4ddc9a3d /fpdfsdk/fpdfdoc_unittest.cpp
parent7149abce42b211ad3c0eaa39a340825acd41a1ec (diff)
downloadpdfium-bb577af2f17467a55c04fbff21a8f0ec1016601a.tar.xz
Remove some objnum locals with AddIndirectObject
Also, it's idempotent, so simplify some logic in callers to not care if objnum is zero. The alternate forms are rarely used, using the objnum form makes it clear that SetReferenceFor() can't possibly register the object as a side-effect. Review-Url: https://codereview.chromium.org/2361713002
Diffstat (limited to 'fpdfsdk/fpdfdoc_unittest.cpp')
-rw-r--r--fpdfsdk/fpdfdoc_unittest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index 5bda8da928..59f9e31e25 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -79,9 +79,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());
- m_pIndirectObjs->AddIndirectObject(obj);
- info.push_back({obj->GetObjNum(), obj});
+ CPDF_Dictionary* obj = new CPDF_Dictionary;
+ info.push_back({m_pIndirectObjs->AddIndirectObject(obj), obj});
}
return info;
}