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

Side by Side Diff: fpdfsdk/fpdfdoc_unittest.cpp

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: Nits 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/formfiller/cba_fontmap.cpp ('k') | fpdfsdk/fpdfeditpage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/fpdf_doc.h" 5 #include "public/fpdf_doc.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "core/fpdfapi/cpdf_modulemgr.h" 10 #include "core/fpdfapi/cpdf_modulemgr.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 122 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
123 bookmarks[1].obj->SetFor( 123 bookmarks[1].obj->SetFor(
124 "Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num)); 124 "Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
125 125
126 bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2")); 126 bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2"));
127 bookmarks[2].obj->SetFor( 127 bookmarks[2].obj->SetFor(
128 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 128 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
129 bookmarks[2].obj->SetFor( 129 bookmarks[2].obj->SetFor(
130 "Prev", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 130 "Prev", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
131 131
132 bookmarks[0].obj->SetFor("Type", new CPDF_Name("Outlines")); 132 bookmarks[0].obj->SetFor("Type", new CPDF_Name(nullptr, "Outlines"));
133 bookmarks[0].obj->SetFor("Count", new CPDF_Number(2)); 133 bookmarks[0].obj->SetFor("Count", new CPDF_Number(2));
134 bookmarks[0].obj->SetFor( 134 bookmarks[0].obj->SetFor(
135 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 135 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
136 bookmarks[0].obj->SetFor( 136 bookmarks[0].obj->SetFor(
137 "Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num)); 137 "Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
138 138
139 m_pRootObj->SetFor("Outlines", 139 m_pRootObj->SetFor("Outlines",
140 new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 140 new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
141 141
142 // Title with no match. 142 // Title with no match.
(...skipping 22 matching lines...) Expand all
165 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 165 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
166 bookmarks[1].obj->SetFor( 166 bookmarks[1].obj->SetFor(
167 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num)); 167 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
168 168
169 bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2")); 169 bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2"));
170 bookmarks[2].obj->SetFor( 170 bookmarks[2].obj->SetFor(
171 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 171 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
172 bookmarks[2].obj->SetFor( 172 bookmarks[2].obj->SetFor(
173 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 173 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
174 174
175 bookmarks[0].obj->SetFor("Type", new CPDF_Name("Outlines")); 175 bookmarks[0].obj->SetFor("Type", new CPDF_Name(nullptr, "Outlines"));
176 bookmarks[0].obj->SetFor("Count", new CPDF_Number(2)); 176 bookmarks[0].obj->SetFor("Count", new CPDF_Number(2));
177 bookmarks[0].obj->SetFor( 177 bookmarks[0].obj->SetFor(
178 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 178 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
179 bookmarks[0].obj->SetFor( 179 bookmarks[0].obj->SetFor(
180 "Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num)); 180 "Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
181 181
182 m_pRootObj->SetFor("Outlines", 182 m_pRootObj->SetFor("Outlines",
183 new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 183 new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
184 184
185 // Title with no match. 185 // Title with no match.
(...skipping 20 matching lines...) Expand all
206 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 206 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
207 bookmarks[2].obj->SetFor( 207 bookmarks[2].obj->SetFor(
208 "Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[3].num)); 208 "Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[3].num));
209 209
210 bookmarks[3].obj->SetFor("Title", new CPDF_String(L"Chapter 3")); 210 bookmarks[3].obj->SetFor("Title", new CPDF_String(L"Chapter 3"));
211 bookmarks[3].obj->SetFor( 211 bookmarks[3].obj->SetFor(
212 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 212 "Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
213 bookmarks[3].obj->SetFor( 213 bookmarks[3].obj->SetFor(
214 "Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 214 "Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
215 215
216 bookmarks[0].obj->SetFor("Type", new CPDF_Name("Outlines")); 216 bookmarks[0].obj->SetFor("Type", new CPDF_Name(nullptr, "Outlines"));
217 bookmarks[0].obj->SetFor("Count", new CPDF_Number(2)); 217 bookmarks[0].obj->SetFor("Count", new CPDF_Number(2));
218 bookmarks[0].obj->SetFor( 218 bookmarks[0].obj->SetFor(
219 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num)); 219 "First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
220 bookmarks[0].obj->SetFor( 220 bookmarks[0].obj->SetFor(
221 "Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num)); 221 "Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
222 222
223 m_pRootObj->SetFor("Outlines", 223 m_pRootObj->SetFor("Outlines",
224 new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num)); 224 new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
225 225
226 // Title with no match. 226 // Title with no match.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 EXPECT_TRUE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom, 264 EXPECT_TRUE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom,
265 &x, &y, &zoom)); 265 &x, &y, &zoom));
266 EXPECT_FALSE(hasX); 266 EXPECT_FALSE(hasX);
267 EXPECT_FALSE(hasY); 267 EXPECT_FALSE(hasY);
268 EXPECT_FALSE(hasZoom); 268 EXPECT_FALSE(hasZoom);
269 269
270 array = pdfium::MakeUnique<CPDF_Array>(); 270 array = pdfium::MakeUnique<CPDF_Array>();
271 EXPECT_FALSE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom, 271 EXPECT_FALSE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom,
272 &x, &y, &zoom)); 272 &x, &y, &zoom));
273 } 273 }
OLDNEW
« no previous file with comments | « fpdfsdk/formfiller/cba_fontmap.cpp ('k') | fpdfsdk/fpdfeditpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698