summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfdoc_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfdoc_unittest.cpp')
-rw-r--r--fpdfsdk/fpdfdoc_unittest.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index 449121d351..6409f70fe2 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -87,7 +87,7 @@ class PDFDocTest : public testing::Test {
protected:
std::unique_ptr<CPDF_TestPdfDocument> m_pDoc;
- CPDF_IndirectObjectHolder* m_pIndirectObjs;
+ CFX_UnownedPtr<CPDF_IndirectObjectHolder> m_pIndirectObjs;
std::unique_ptr<CPDF_Dictionary> m_pRootObj;
};
@@ -116,25 +116,25 @@ TEST_F(PDFDocTest, FindBookmark) {
auto bookmarks = CreateDictObjs(3);
bookmarks[1].obj->SetNewFor<CPDF_String>("Title", L"Chapter 1");
- bookmarks[1].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[1].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[0].num);
- bookmarks[1].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs,
+ bookmarks[1].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs.Get(),
bookmarks[2].num);
bookmarks[2].obj->SetNewFor<CPDF_String>("Title", L"Chapter 2");
- bookmarks[2].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[2].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[0].num);
- bookmarks[2].obj->SetNewFor<CPDF_Reference>("Prev", m_pIndirectObjs,
+ bookmarks[2].obj->SetNewFor<CPDF_Reference>("Prev", m_pIndirectObjs.Get(),
bookmarks[1].num);
bookmarks[0].obj->SetNewFor<CPDF_Name>("Type", "Outlines");
bookmarks[0].obj->SetNewFor<CPDF_Number>("Count", 2);
- bookmarks[0].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs,
+ bookmarks[0].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs.Get(),
bookmarks[1].num);
- bookmarks[0].obj->SetNewFor<CPDF_Reference>("Last", m_pIndirectObjs,
+ bookmarks[0].obj->SetNewFor<CPDF_Reference>("Last", m_pIndirectObjs.Get(),
bookmarks[2].num);
- m_pRootObj->SetNewFor<CPDF_Reference>("Outlines", m_pIndirectObjs,
+ m_pRootObj->SetNewFor<CPDF_Reference>("Outlines", m_pIndirectObjs.Get(),
bookmarks[0].num);
// Title with no match.
@@ -159,25 +159,25 @@ TEST_F(PDFDocTest, FindBookmark) {
auto bookmarks = CreateDictObjs(3);
bookmarks[1].obj->SetNewFor<CPDF_String>("Title", L"Chapter 1");
- bookmarks[1].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[1].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[0].num);
- bookmarks[1].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs,
+ bookmarks[1].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs.Get(),
bookmarks[2].num);
bookmarks[2].obj->SetNewFor<CPDF_String>("Title", L"Chapter 2");
- bookmarks[2].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[2].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[1].num);
- bookmarks[2].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs,
+ bookmarks[2].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs.Get(),
bookmarks[1].num);
bookmarks[0].obj->SetNewFor<CPDF_Name>("Type", "Outlines");
bookmarks[0].obj->SetNewFor<CPDF_Number>("Count", 2);
- bookmarks[0].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs,
+ bookmarks[0].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs.Get(),
bookmarks[1].num);
- bookmarks[0].obj->SetNewFor<CPDF_Reference>("Last", m_pIndirectObjs,
+ bookmarks[0].obj->SetNewFor<CPDF_Reference>("Last", m_pIndirectObjs.Get(),
bookmarks[2].num);
- m_pRootObj->SetNewFor<CPDF_Reference>("Outlines", m_pIndirectObjs,
+ m_pRootObj->SetNewFor<CPDF_Reference>("Outlines", m_pIndirectObjs.Get(),
bookmarks[0].num);
// Title with no match.
@@ -194,31 +194,31 @@ TEST_F(PDFDocTest, FindBookmark) {
auto bookmarks = CreateDictObjs(4);
bookmarks[1].obj->SetNewFor<CPDF_String>("Title", L"Chapter 1");
- bookmarks[1].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[1].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[0].num);
- bookmarks[1].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs,
+ bookmarks[1].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs.Get(),
bookmarks[2].num);
bookmarks[2].obj->SetNewFor<CPDF_String>("Title", L"Chapter 2");
- bookmarks[2].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[2].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[0].num);
- bookmarks[2].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs,
+ bookmarks[2].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs.Get(),
bookmarks[3].num);
bookmarks[3].obj->SetNewFor<CPDF_String>("Title", L"Chapter 3");
- bookmarks[3].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs,
+ bookmarks[3].obj->SetNewFor<CPDF_Reference>("Parent", m_pIndirectObjs.Get(),
bookmarks[0].num);
- bookmarks[3].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs,
+ bookmarks[3].obj->SetNewFor<CPDF_Reference>("Next", m_pIndirectObjs.Get(),
bookmarks[1].num);
bookmarks[0].obj->SetNewFor<CPDF_Name>("Type", "Outlines");
bookmarks[0].obj->SetNewFor<CPDF_Number>("Count", 2);
- bookmarks[0].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs,
+ bookmarks[0].obj->SetNewFor<CPDF_Reference>("First", m_pIndirectObjs.Get(),
bookmarks[1].num);
- bookmarks[0].obj->SetNewFor<CPDF_Reference>("Last", m_pIndirectObjs,
+ bookmarks[0].obj->SetNewFor<CPDF_Reference>("Last", m_pIndirectObjs.Get(),
bookmarks[2].num);
- m_pRootObj->SetNewFor<CPDF_Reference>("Outlines", m_pIndirectObjs,
+ m_pRootObj->SetNewFor<CPDF_Reference>("Outlines", m_pIndirectObjs.Get(),
bookmarks[0].num);
// Title with no match.