summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfdoc_unittest.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-09-15 10:15:32 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-15 10:15:32 -0700
commit38fd84428a1ea007a043be0b7d9b289e47aa5da0 (patch)
tree2bae09e8ae60d6d86e451eb7fa212f7aa9d899a8 /fpdfsdk/fpdfdoc_unittest.cpp
parent41d6bbe3d413e7854be89142b70c42a89e315cba (diff)
downloadpdfium-38fd84428a1ea007a043be0b7d9b289e47aa5da0.tar.xz
Rename dictionary set and get methods
This Cl makes the Get and Set methods consistenly use {G|S}et<Type>For. BUG=pdfium:596 Review-Url: https://codereview.chromium.org/2334323005
Diffstat (limited to 'fpdfsdk/fpdfdoc_unittest.cpp')
-rw-r--r--fpdfsdk/fpdfdoc_unittest.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index a555e961f3..5bda8da928 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -104,7 +104,7 @@ TEST_F(PDFDocTest, FindBookmark) {
}
{
// Empty bookmark tree.
- m_pRootObj->SetAt("Outlines", new CPDF_Dictionary());
+ m_pRootObj->SetFor("Outlines", new CPDF_Dictionary());
std::unique_ptr<unsigned short, pdfium::FreeDeleter> title =
GetFPDFWideString(L"");
EXPECT_EQ(nullptr, FPDFBookmark_Find(m_pDoc.get(), title.get()));
@@ -116,27 +116,27 @@ TEST_F(PDFDocTest, FindBookmark) {
// Check on a regular bookmark tree.
auto bookmarks = CreateDictObjs(3);
- bookmarks[1].obj->SetAt("Title", new CPDF_String(L"Chapter 1"));
- bookmarks[1].obj->SetAt(
+ bookmarks[1].obj->SetFor("Title", new CPDF_String(L"Chapter 1"));
+ bookmarks[1].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
- bookmarks[1].obj->SetAt(
+ bookmarks[1].obj->SetFor(
"Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
- bookmarks[2].obj->SetAt("Title", new CPDF_String(L"Chapter 2"));
- bookmarks[2].obj->SetAt(
+ bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2"));
+ bookmarks[2].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
- bookmarks[2].obj->SetAt(
+ bookmarks[2].obj->SetFor(
"Prev", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[0].obj->SetAt("Type", new CPDF_Name("Outlines"));
- bookmarks[0].obj->SetAt("Count", new CPDF_Number(2));
- bookmarks[0].obj->SetAt(
+ bookmarks[0].obj->SetFor("Type", new CPDF_Name("Outlines"));
+ bookmarks[0].obj->SetFor("Count", new CPDF_Number(2));
+ bookmarks[0].obj->SetFor(
"First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[0].obj->SetAt(
+ bookmarks[0].obj->SetFor(
"Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
- m_pRootObj->SetAt("Outlines",
- new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
+ m_pRootObj->SetFor("Outlines",
+ new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
// Title with no match.
std::unique_ptr<unsigned short, pdfium::FreeDeleter> title =
@@ -159,27 +159,27 @@ TEST_F(PDFDocTest, FindBookmark) {
// Circular bookmarks in depth.
auto bookmarks = CreateDictObjs(3);
- bookmarks[1].obj->SetAt("Title", new CPDF_String(L"Chapter 1"));
- bookmarks[1].obj->SetAt(
+ bookmarks[1].obj->SetFor("Title", new CPDF_String(L"Chapter 1"));
+ bookmarks[1].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
- bookmarks[1].obj->SetAt(
+ bookmarks[1].obj->SetFor(
"First", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
- bookmarks[2].obj->SetAt("Title", new CPDF_String(L"Chapter 2"));
- bookmarks[2].obj->SetAt(
+ bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2"));
+ bookmarks[2].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[2].obj->SetAt(
+ bookmarks[2].obj->SetFor(
"First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[0].obj->SetAt("Type", new CPDF_Name("Outlines"));
- bookmarks[0].obj->SetAt("Count", new CPDF_Number(2));
- bookmarks[0].obj->SetAt(
+ bookmarks[0].obj->SetFor("Type", new CPDF_Name("Outlines"));
+ bookmarks[0].obj->SetFor("Count", new CPDF_Number(2));
+ bookmarks[0].obj->SetFor(
"First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[0].obj->SetAt(
+ bookmarks[0].obj->SetFor(
"Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
- m_pRootObj->SetAt("Outlines",
- new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
+ m_pRootObj->SetFor("Outlines",
+ new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
// Title with no match.
std::unique_ptr<unsigned short, pdfium::FreeDeleter> title =
@@ -194,33 +194,33 @@ TEST_F(PDFDocTest, FindBookmark) {
// Circular bookmarks in breadth.
auto bookmarks = CreateDictObjs(4);
- bookmarks[1].obj->SetAt("Title", new CPDF_String(L"Chapter 1"));
- bookmarks[1].obj->SetAt(
+ bookmarks[1].obj->SetFor("Title", new CPDF_String(L"Chapter 1"));
+ bookmarks[1].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
- bookmarks[1].obj->SetAt(
+ bookmarks[1].obj->SetFor(
"Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
- bookmarks[2].obj->SetAt("Title", new CPDF_String(L"Chapter 2"));
- bookmarks[2].obj->SetAt(
+ bookmarks[2].obj->SetFor("Title", new CPDF_String(L"Chapter 2"));
+ bookmarks[2].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
- bookmarks[2].obj->SetAt(
+ bookmarks[2].obj->SetFor(
"Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[3].num));
- bookmarks[3].obj->SetAt("Title", new CPDF_String(L"Chapter 3"));
- bookmarks[3].obj->SetAt(
+ bookmarks[3].obj->SetFor("Title", new CPDF_String(L"Chapter 3"));
+ bookmarks[3].obj->SetFor(
"Parent", new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
- bookmarks[3].obj->SetAt(
+ bookmarks[3].obj->SetFor(
"Next", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[0].obj->SetAt("Type", new CPDF_Name("Outlines"));
- bookmarks[0].obj->SetAt("Count", new CPDF_Number(2));
- bookmarks[0].obj->SetAt(
+ bookmarks[0].obj->SetFor("Type", new CPDF_Name("Outlines"));
+ bookmarks[0].obj->SetFor("Count", new CPDF_Number(2));
+ bookmarks[0].obj->SetFor(
"First", new CPDF_Reference(m_pIndirectObjs, bookmarks[1].num));
- bookmarks[0].obj->SetAt(
+ bookmarks[0].obj->SetFor(
"Last", new CPDF_Reference(m_pIndirectObjs, bookmarks[2].num));
- m_pRootObj->SetAt("Outlines",
- new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
+ m_pRootObj->SetFor("Outlines",
+ new CPDF_Reference(m_pIndirectObjs, bookmarks[0].num));
// Title with no match.
std::unique_ptr<unsigned short, pdfium::FreeDeleter> title =