68 ScopedFPDFWideString title = GetFPDFWideString(L"");
69 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
71 title = GetFPDFWideString(L"Preface");
72 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
76 m_pRootObj->SetNewFor<CPDF_Dictionary>(
"Outlines");
77 ScopedFPDFWideString title = GetFPDFWideString(L"");
78 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
80 title = GetFPDFWideString(L"Preface");
81 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
85 auto bookmarks = CreateDictObjs(3);
87 bookmarks[1].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 1");
88 bookmarks[1].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
90 bookmarks[1].obj->SetNewFor<CPDF_Reference>(
"Next", m_pIndirectObjs,
93 bookmarks[2].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 2");
94 bookmarks[2].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
96 bookmarks[2].obj->SetNewFor<CPDF_Reference>(
"Prev", m_pIndirectObjs,
99 bookmarks[0].obj->SetNewFor<CPDF_Name>(
"Type",
"Outlines");
100 bookmarks[0].obj->SetNewFor<CPDF_Number>(
"Count", 2);
101 bookmarks[0].obj->SetNewFor<CPDF_Reference>(
"First", m_pIndirectObjs,
103 bookmarks[0].obj->SetNewFor<CPDF_Reference>(
"Last", m_pIndirectObjs,
106 m_pRootObj->SetNewFor<CPDF_Reference>(
"Outlines", m_pIndirectObjs,
110 ScopedFPDFWideString title = GetFPDFWideString(L"Chapter 3");
111 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
114 title = GetFPDFWideString(L"Chapter");
115 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
118 title = GetFPDFWideString(L"Chapter 2");
119 EXPECT_EQ(FPDFBookmarkFromCPDFDictionary(bookmarks[2].obj.Get()),
120 FPDFBookmark_Find(m_pDoc.get(), title.get()));
123 title = GetFPDFWideString(L"cHaPter 2");
124 EXPECT_EQ(FPDFBookmarkFromCPDFDictionary(bookmarks[2].obj.Get()),
125 FPDFBookmark_Find(m_pDoc.get(), title.get()));
129 auto bookmarks = CreateDictObjs(3);
131 bookmarks[1].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 1");
132 bookmarks[1].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
134 bookmarks[1].obj->SetNewFor<CPDF_Reference>(
"First", m_pIndirectObjs,
137 bookmarks[2].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 2");
138 bookmarks[2].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
140 bookmarks[2].obj->SetNewFor<CPDF_Reference>(
"First", m_pIndirectObjs,
143 bookmarks[0].obj->SetNewFor<CPDF_Name>(
"Type",
"Outlines");
144 bookmarks[0].obj->SetNewFor<CPDF_Number>(
"Count", 2);
145 bookmarks[0].obj->SetNewFor<CPDF_Reference>(
"First", m_pIndirectObjs,
147 bookmarks[0].obj->SetNewFor<CPDF_Reference>(
"Last", m_pIndirectObjs,
150 m_pRootObj->SetNewFor<CPDF_Reference>(
"Outlines", m_pIndirectObjs,
154 ScopedFPDFWideString title = GetFPDFWideString(L"Chapter 3");
155 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
158 title = GetFPDFWideString(L"Chapter 2");
159 EXPECT_EQ(FPDFBookmarkFromCPDFDictionary(bookmarks[2].obj.Get()),
160 FPDFBookmark_Find(m_pDoc.get(), title.get()));
164 auto bookmarks = CreateDictObjs(4);
166 bookmarks[1].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 1");
167 bookmarks[1].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
169 bookmarks[1].obj->SetNewFor<CPDF_Reference>(
"Next", m_pIndirectObjs,
172 bookmarks[2].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 2");
173 bookmarks[2].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
175 bookmarks[2].obj->SetNewFor<CPDF_Reference>(
"Next", m_pIndirectObjs,
178 bookmarks[3].obj->SetNewFor<CPDF_String>(
"Title", L"Chapter 3");
179 bookmarks[3].obj->SetNewFor<CPDF_Reference>(
"Parent", m_pIndirectObjs,
181 bookmarks[3].obj->SetNewFor<CPDF_Reference>(
"Next", m_pIndirectObjs,
184 bookmarks[0].obj->SetNewFor<CPDF_Name>(
"Type",
"Outlines");
185 bookmarks[0].obj->SetNewFor<CPDF_Number>(
"Count", 2);
186 bookmarks[0].obj->SetNewFor<CPDF_Reference>(
"First", m_pIndirectObjs,
188 bookmarks[0].obj->SetNewFor<CPDF_Reference>(
"Last", m_pIndirectObjs,
191 m_pRootObj->SetNewFor<CPDF_Reference>(
"Outlines", m_pIndirectObjs,
195 ScopedFPDFWideString title = GetFPDFWideString(L"Chapter 8");
196 EXPECT_FALSE(FPDFBookmark_Find(m_pDoc.get(), title.get()));
199 title = GetFPDFWideString(L"Chapter 3");
200 EXPECT_EQ(FPDFBookmarkFromCPDFDictionary(bookmarks[3].obj.Get()),
201 FPDFBookmark_Find(m_pDoc.get(), title.get()));
206 auto array = pdfium::MakeRetain<CPDF_Array>();
207 array->AppendNew<CPDF_Number>(0);
208 array->AppendNew<CPDF_Name>(
"XYZ");
209 array->AppendNew<CPDF_Number>(4);
210 array->AppendNew<CPDF_Number>(5);
211 array->AppendNew<CPDF_Number>(6);
220 EXPECT_TRUE(FPDFDest_GetLocationInPage(FPDFDestFromCPDFArray(array.Get()),
221 &hasX, &hasY, &hasZoom, &x, &y,
225 EXPECT_TRUE(hasZoom);
230 array->SetNewAt<CPDF_Null>(2);
231 array->SetNewAt<CPDF_Null>(3);
232 array->SetNewAt<CPDF_Null>(4);
233 EXPECT_TRUE(FPDFDest_GetLocationInPage(FPDFDestFromCPDFArray(array.Get()),
234 &hasX, &hasY, &hasZoom, &x, &y,
238 EXPECT_FALSE(hasZoom);
240 array = pdfium::MakeRetain<CPDF_Array>();
241 EXPECT_FALSE(FPDFDest_GetLocationInPage(FPDFDestFromCPDFArray(array.Get()),
242 &hasX, &hasY, &hasZoom, &x, &y,