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

Unified Diff: fpdfsdk/fpdfdoc_unittest.cpp

Issue 2489283003: Make AddIndirectObject() take a unique_ptr. (Closed)
Patch Set: Address review comments Created 4 years, 1 month 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/fpdf_transformpage.cpp ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfdoc_unittest.cpp
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index fc902570b41c22baf1712c46177f9a100f311388..7d1d6b4ba875d0c8b4e989698085134be46a88a1 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -81,8 +81,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->NewIndirect<CPDF_Dictionary>();
+ info.push_back({obj->GetObjNum(), obj});
}
return info;
}
« no previous file with comments | « fpdfsdk/fpdf_transformpage.cpp ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698