summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Wennborg <hans@chromium.org>2018-10-22 19:17:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-22 19:17:02 +0000
commit2f62d36bfac781428f3896b443177e033be4c554 (patch)
tree4e77be5f0da1335ae54adfe7d62a7200cd134bbb
parentc320e9c7ad01ab48625e51fb3b6476d98b6167de (diff)
downloadpdfium-2f62d36bfac781428f3896b443177e033be4c554.tar.xz
Rename CPDF_Object::Type enumerators with k prefixes
This was originally motivated by Clang's newly enhanced -Wshadow warning, which complained about BOOLEAN shadowing a BOOLEAN typedef in winnt.h. The warning has since been changed to not fire on enums shadowing types, but it was suggested that this kind of naming change was desirable anyway. Bug: chromium:895475 Change-Id: I278ce9dbbd88f802fe5bc77fca28b082aa5e684d Reviewed-on: https://pdfium-review.googlesource.com/c/44330 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp4
-rw-r--r--core/fpdfapi/parser/cpdf_array.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_boolean.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_data_avail.cpp8
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_name.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_null.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_number.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_object.h18
-rw-r--r--core/fpdfapi/parser/cpdf_object_unittest.cpp54
-rw-r--r--core/fpdfapi/parser/cpdf_reference.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_stream.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_string.cpp2
-rw-r--r--core/fpdfapi/parser/fpdf_parser_utility.cpp18
-rw-r--r--core/fpdfdoc/cpdf_formfield.cpp6
-rw-r--r--fpdfsdk/fpdf_annot.cpp39
-rw-r--r--fpdfsdk/fpdf_ppo.cpp8
17 files changed, 88 insertions, 85 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index beba208739..6e930f62bb 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -173,7 +173,7 @@ ByteStringView FindFullName(const AbbrPair* table,
void ReplaceAbbr(CPDF_Object* pObj) {
switch (pObj->GetType()) {
- case CPDF_Object::DICTIONARY: {
+ case CPDF_Object::kDictionary: {
std::vector<AbbrReplacementOp> replacements;
CPDF_Dictionary* pDict = pObj->AsDictionary();
{
@@ -217,7 +217,7 @@ void ReplaceAbbr(CPDF_Object* pObj) {
}
break;
}
- case CPDF_Object::ARRAY: {
+ case CPDF_Object::kArray: {
CPDF_Array* pArray = pObj->AsArray();
for (size_t i = 0; i < pArray->size(); i++) {
CPDF_Object* pElement = pArray->GetObjectAt(i);
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index e0ac34169f..78a52f9694 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -33,7 +33,7 @@ CPDF_Array::~CPDF_Array() {
}
CPDF_Object::Type CPDF_Array::GetType() const {
- return ARRAY;
+ return kArray;
}
bool CPDF_Array::IsArray() const {
diff --git a/core/fpdfapi/parser/cpdf_boolean.cpp b/core/fpdfapi/parser/cpdf_boolean.cpp
index 6066c80809..fdf5b5784d 100644
--- a/core/fpdfapi/parser/cpdf_boolean.cpp
+++ b/core/fpdfapi/parser/cpdf_boolean.cpp
@@ -16,7 +16,7 @@ CPDF_Boolean::CPDF_Boolean(bool value) : m_bValue(value) {}
CPDF_Boolean::~CPDF_Boolean() {}
CPDF_Object::Type CPDF_Boolean::GetType() const {
- return BOOLEAN;
+ return kBoolean;
}
std::unique_ptr<CPDF_Object> CPDF_Boolean::Clone() const {
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index b685214f6f..43c0cb799c 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -353,10 +353,10 @@ bool CPDF_DataAvail::GetPageKids(CPDF_Object* pPages) {
return true;
switch (pKids->GetType()) {
- case CPDF_Object::REFERENCE:
+ case CPDF_Object::kReference:
m_PageObjList.push_back(pKids->AsReference()->GetRefObjNum());
break;
- case CPDF_Object::ARRAY: {
+ case CPDF_Object::kArray: {
CPDF_Array* pKidsArray = pKids->AsArray();
for (size_t i = 0; i < pKidsArray->size(); ++i) {
if (CPDF_Reference* pRef = ToReference(pKidsArray->GetObjectAt(i)))
@@ -602,14 +602,14 @@ bool CPDF_DataAvail::CheckUnknownPageNode(uint32_t dwPageNo,
}
switch (pKids->GetType()) {
- case CPDF_Object::REFERENCE: {
+ case CPDF_Object::kReference: {
CPDF_Reference* pKid = pKids->AsReference();
auto pNode = pdfium::MakeUnique<PageNode>();
pNode->m_dwPageNo = pKid->GetRefObjNum();
pPageNode->m_ChildNodes.push_back(std::move(pNode));
break;
}
- case CPDF_Object::ARRAY: {
+ case CPDF_Object::kArray: {
CPDF_Array* pKidsArray = pKids->AsArray();
for (size_t i = 0; i < pKidsArray->size(); ++i) {
CPDF_Reference* pKid = ToReference(pKidsArray->GetObjectAt(i));
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index 6c005c8db2..c514e797e3 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/parser/cpdf_dictionary.cpp
@@ -40,7 +40,7 @@ CPDF_Dictionary::~CPDF_Dictionary() {
}
CPDF_Object::Type CPDF_Dictionary::GetType() const {
- return DICTIONARY;
+ return kDictionary;
}
CPDF_Dictionary* CPDF_Dictionary::GetDict() {
diff --git a/core/fpdfapi/parser/cpdf_name.cpp b/core/fpdfapi/parser/cpdf_name.cpp
index d35a76c8a0..721c58a3c7 100644
--- a/core/fpdfapi/parser/cpdf_name.cpp
+++ b/core/fpdfapi/parser/cpdf_name.cpp
@@ -20,7 +20,7 @@ CPDF_Name::CPDF_Name(WeakPtr<ByteStringPool> pPool, const ByteString& str)
CPDF_Name::~CPDF_Name() {}
CPDF_Object::Type CPDF_Name::GetType() const {
- return NAME;
+ return kName;
}
std::unique_ptr<CPDF_Object> CPDF_Name::Clone() const {
diff --git a/core/fpdfapi/parser/cpdf_null.cpp b/core/fpdfapi/parser/cpdf_null.cpp
index 18c135c3ab..2a0a89095d 100644
--- a/core/fpdfapi/parser/cpdf_null.cpp
+++ b/core/fpdfapi/parser/cpdf_null.cpp
@@ -12,7 +12,7 @@
CPDF_Null::CPDF_Null() {}
CPDF_Object::Type CPDF_Null::GetType() const {
- return NULLOBJ;
+ return kNullobj;
}
std::unique_ptr<CPDF_Object> CPDF_Null::Clone() const {
diff --git a/core/fpdfapi/parser/cpdf_number.cpp b/core/fpdfapi/parser/cpdf_number.cpp
index 221a1ce760..5b618a79b0 100644
--- a/core/fpdfapi/parser/cpdf_number.cpp
+++ b/core/fpdfapi/parser/cpdf_number.cpp
@@ -20,7 +20,7 @@ CPDF_Number::CPDF_Number(const ByteStringView& str) : m_Number(str) {}
CPDF_Number::~CPDF_Number() {}
CPDF_Object::Type CPDF_Number::GetType() const {
- return NUMBER;
+ return kNumber;
}
std::unique_ptr<CPDF_Object> CPDF_Number::Clone() const {
diff --git a/core/fpdfapi/parser/cpdf_object.h b/core/fpdfapi/parser/cpdf_object.h
index 4f64aec265..9404ad248f 100644
--- a/core/fpdfapi/parser/cpdf_object.h
+++ b/core/fpdfapi/parser/cpdf_object.h
@@ -31,15 +31,15 @@ class CPDF_Object {
public:
static const uint32_t kInvalidObjNum = static_cast<uint32_t>(-1);
enum Type {
- BOOLEAN = 1,
- NUMBER,
- STRING,
- NAME,
- ARRAY,
- DICTIONARY,
- STREAM,
- NULLOBJ,
- REFERENCE
+ kBoolean = 1,
+ kNumber,
+ kString,
+ kName,
+ kArray,
+ kDictionary,
+ kStream,
+ kNullobj,
+ kReference
};
virtual ~CPDF_Object();
diff --git a/core/fpdfapi/parser/cpdf_object_unittest.cpp b/core/fpdfapi/parser/cpdf_object_unittest.cpp
index c3ec3aeddb..0b6909660b 100644
--- a/core/fpdfapi/parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_object_unittest.cpp
@@ -86,10 +86,10 @@ class PDFObjectsTest : public testing::Test {
name_obj, m_ArrayObj.Get(), m_DictObj.Get(),
stream_obj, null_obj};
m_DirectObjTypes = {
- CPDF_Object::BOOLEAN, CPDF_Object::BOOLEAN, CPDF_Object::NUMBER,
- CPDF_Object::NUMBER, CPDF_Object::STRING, CPDF_Object::STRING,
- CPDF_Object::NAME, CPDF_Object::ARRAY, CPDF_Object::DICTIONARY,
- CPDF_Object::STREAM, CPDF_Object::NULLOBJ};
+ CPDF_Object::kBoolean, CPDF_Object::kBoolean, CPDF_Object::kNumber,
+ CPDF_Object::kNumber, CPDF_Object::kString, CPDF_Object::kString,
+ CPDF_Object::kName, CPDF_Object::kArray, CPDF_Object::kDictionary,
+ CPDF_Object::kStream, CPDF_Object::kNullobj};
for (size_t i = 0; i < FX_ArraySize(objs); ++i)
m_DirectObjs.emplace_back(objs[i]);
@@ -114,15 +114,15 @@ class PDFObjectsTest : public testing::Test {
if (!obj1 || !obj2 || obj1->GetType() != obj2->GetType())
return false;
switch (obj1->GetType()) {
- case CPDF_Object::BOOLEAN:
+ case CPDF_Object::kBoolean:
return obj1->GetInteger() == obj2->GetInteger();
- case CPDF_Object::NUMBER:
+ case CPDF_Object::kNumber:
return obj1->AsNumber()->IsInteger() == obj2->AsNumber()->IsInteger() &&
obj1->GetInteger() == obj2->GetInteger();
- case CPDF_Object::STRING:
- case CPDF_Object::NAME:
+ case CPDF_Object::kString:
+ case CPDF_Object::kName:
return obj1->GetString() == obj2->GetString();
- case CPDF_Object::ARRAY: {
+ case CPDF_Object::kArray: {
const CPDF_Array* array1 = obj1->AsArray();
const CPDF_Array* array2 = obj2->AsArray();
if (array1->size() != array2->size())
@@ -133,7 +133,7 @@ class PDFObjectsTest : public testing::Test {
}
return true;
}
- case CPDF_Object::DICTIONARY: {
+ case CPDF_Object::kDictionary: {
const CPDF_Dictionary* dict1 = obj1->AsDictionary();
const CPDF_Dictionary* dict2 = obj2->AsDictionary();
if (dict1->size() != dict2->size())
@@ -145,9 +145,9 @@ class PDFObjectsTest : public testing::Test {
}
return true;
}
- case CPDF_Object::NULLOBJ:
+ case CPDF_Object::kNullobj:
return true;
- case CPDF_Object::STREAM: {
+ case CPDF_Object::kStream: {
const CPDF_Stream* stream1 = obj1->AsStream();
const CPDF_Stream* stream2 = obj2->AsStream();
if (!stream1->GetDict() && !stream2->GetDict())
@@ -168,7 +168,7 @@ class PDFObjectsTest : public testing::Test {
return memcmp(streamAcc1->GetData(), streamAcc2->GetData(),
streamAcc2->GetSize()) == 0;
}
- case CPDF_Object::REFERENCE:
+ case CPDF_Object::kReference:
return obj1->AsReference()->GetRefObjNum() ==
obj2->AsReference()->GetRefObjNum();
}
@@ -300,7 +300,7 @@ TEST_F(PDFObjectsTest, GetType) {
// Check indirect references.
for (const auto& it : m_RefObjs)
- EXPECT_EQ(CPDF_Object::REFERENCE, it->GetType());
+ EXPECT_EQ(CPDF_Object::kReference, it->GetType());
}
TEST_F(PDFObjectsTest, GetDirect) {
@@ -328,7 +328,7 @@ TEST_F(PDFObjectsTest, SetString) {
TEST_F(PDFObjectsTest, IsTypeAndAsType) {
// Check for direct objects.
for (size_t i = 0; i < m_DirectObjs.size(); ++i) {
- if (m_DirectObjTypes[i] == CPDF_Object::ARRAY) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kArray) {
EXPECT_TRUE(m_DirectObjs[i]->IsArray());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsArray());
} else {
@@ -336,7 +336,7 @@ TEST_F(PDFObjectsTest, IsTypeAndAsType) {
EXPECT_EQ(nullptr, m_DirectObjs[i]->AsArray());
}
- if (m_DirectObjTypes[i] == CPDF_Object::BOOLEAN) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kBoolean) {
EXPECT_TRUE(m_DirectObjs[i]->IsBoolean());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsBoolean());
} else {
@@ -344,7 +344,7 @@ TEST_F(PDFObjectsTest, IsTypeAndAsType) {
EXPECT_EQ(nullptr, m_DirectObjs[i]->AsBoolean());
}
- if (m_DirectObjTypes[i] == CPDF_Object::NAME) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kName) {
EXPECT_TRUE(m_DirectObjs[i]->IsName());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsName());
} else {
@@ -352,7 +352,7 @@ TEST_F(PDFObjectsTest, IsTypeAndAsType) {
EXPECT_EQ(nullptr, m_DirectObjs[i]->AsName());
}
- if (m_DirectObjTypes[i] == CPDF_Object::NUMBER) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kNumber) {
EXPECT_TRUE(m_DirectObjs[i]->IsNumber());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsNumber());
} else {
@@ -360,7 +360,7 @@ TEST_F(PDFObjectsTest, IsTypeAndAsType) {
EXPECT_EQ(nullptr, m_DirectObjs[i]->AsNumber());
}
- if (m_DirectObjTypes[i] == CPDF_Object::STRING) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kString) {
EXPECT_TRUE(m_DirectObjs[i]->IsString());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsString());
} else {
@@ -368,7 +368,7 @@ TEST_F(PDFObjectsTest, IsTypeAndAsType) {
EXPECT_EQ(nullptr, m_DirectObjs[i]->AsString());
}
- if (m_DirectObjTypes[i] == CPDF_Object::DICTIONARY) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kDictionary) {
EXPECT_TRUE(m_DirectObjs[i]->IsDictionary());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsDictionary());
} else {
@@ -376,7 +376,7 @@ TEST_F(PDFObjectsTest, IsTypeAndAsType) {
EXPECT_EQ(nullptr, m_DirectObjs[i]->AsDictionary());
}
- if (m_DirectObjTypes[i] == CPDF_Object::STREAM) {
+ if (m_DirectObjTypes[i] == CPDF_Object::kStream) {
EXPECT_TRUE(m_DirectObjs[i]->IsStream());
EXPECT_EQ(m_DirectObjs[i].get(), m_DirectObjs[i]->AsStream());
} else {
@@ -697,7 +697,7 @@ TEST(PDFArrayTest, AddNumber) {
for (size_t i = 0; i < FX_ArraySize(vals); ++i)
arr->AddNew<CPDF_Number>(vals[i]);
for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
- EXPECT_EQ(CPDF_Object::NUMBER, arr->GetObjectAt(i)->GetType());
+ EXPECT_EQ(CPDF_Object::kNumber, arr->GetObjectAt(i)->GetType());
EXPECT_EQ(vals[i], arr->GetObjectAt(i)->GetNumber());
}
}
@@ -708,7 +708,7 @@ TEST(PDFArrayTest, AddInteger) {
for (size_t i = 0; i < FX_ArraySize(vals); ++i)
arr->AddNew<CPDF_Number>(vals[i]);
for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
- EXPECT_EQ(CPDF_Object::NUMBER, arr->GetObjectAt(i)->GetType());
+ EXPECT_EQ(CPDF_Object::kNumber, arr->GetObjectAt(i)->GetType());
EXPECT_EQ(vals[i], arr->GetObjectAt(i)->GetNumber());
}
}
@@ -724,9 +724,9 @@ TEST(PDFArrayTest, AddStringAndName) {
name_array->AddNew<CPDF_Name>(vals[i]);
}
for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
- EXPECT_EQ(CPDF_Object::STRING, string_array->GetObjectAt(i)->GetType());
+ EXPECT_EQ(CPDF_Object::kString, string_array->GetObjectAt(i)->GetType());
EXPECT_STREQ(vals[i], string_array->GetObjectAt(i)->GetString().c_str());
- EXPECT_EQ(CPDF_Object::NAME, name_array->GetObjectAt(i)->GetType());
+ EXPECT_EQ(CPDF_Object::kName, name_array->GetObjectAt(i)->GetType());
EXPECT_STREQ(vals[i], name_array->GetObjectAt(i)->GetString().c_str());
}
}
@@ -758,10 +758,10 @@ TEST(PDFArrayTest, AddReferenceAndGetObjectAt) {
// Check arrays.
EXPECT_EQ(arr->size(), arr1->size());
for (size_t i = 0; i < arr->size(); ++i) {
- EXPECT_EQ(CPDF_Object::REFERENCE, arr->GetObjectAt(i)->GetType());
+ EXPECT_EQ(CPDF_Object::kReference, arr->GetObjectAt(i)->GetType());
EXPECT_EQ(indirect_objs[i], arr->GetObjectAt(i)->GetDirect());
EXPECT_EQ(indirect_objs[i], arr->GetDirectObjectAt(i));
- EXPECT_EQ(CPDF_Object::REFERENCE, arr1->GetObjectAt(i)->GetType());
+ EXPECT_EQ(CPDF_Object::kReference, arr1->GetObjectAt(i)->GetType());
EXPECT_EQ(indirect_objs[i], arr1->GetObjectAt(i)->GetDirect());
EXPECT_EQ(indirect_objs[i], arr1->GetDirectObjectAt(i));
}
diff --git a/core/fpdfapi/parser/cpdf_reference.cpp b/core/fpdfapi/parser/cpdf_reference.cpp
index 5a4d58a0e2..6885d2c6c7 100644
--- a/core/fpdfapi/parser/cpdf_reference.cpp
+++ b/core/fpdfapi/parser/cpdf_reference.cpp
@@ -17,7 +17,7 @@ CPDF_Reference::CPDF_Reference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum)
CPDF_Reference::~CPDF_Reference() {}
CPDF_Object::Type CPDF_Reference::GetType() const {
- return REFERENCE;
+ return kReference;
}
ByteString CPDF_Reference::GetString() const {
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp
index 81d0e840c0..38374626ac 100644
--- a/core/fpdfapi/parser/cpdf_stream.cpp
+++ b/core/fpdfapi/parser/cpdf_stream.cpp
@@ -46,7 +46,7 @@ CPDF_Stream::~CPDF_Stream() {
}
CPDF_Object::Type CPDF_Stream::GetType() const {
- return STREAM;
+ return kStream;
}
CPDF_Dictionary* CPDF_Stream::GetDict() {
diff --git a/core/fpdfapi/parser/cpdf_string.cpp b/core/fpdfapi/parser/cpdf_string.cpp
index e7f2a9dcd6..08f3db30d8 100644
--- a/core/fpdfapi/parser/cpdf_string.cpp
+++ b/core/fpdfapi/parser/cpdf_string.cpp
@@ -33,7 +33,7 @@ CPDF_String::CPDF_String(WeakPtr<ByteStringPool> pPool, const WideString& str)
CPDF_String::~CPDF_String() {}
CPDF_Object::Type CPDF_String::GetType() const {
- return STRING;
+ return kString;
}
std::unique_ptr<CPDF_Object> CPDF_String::Clone() const {
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index e6972984ea..f25d68bb5e 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -158,26 +158,26 @@ std::ostream& operator<<(std::ostream& buf, const CPDF_Object* pObj) {
return buf;
}
switch (pObj->GetType()) {
- case CPDF_Object::NULLOBJ:
+ case CPDF_Object::kNullobj:
buf << " null";
break;
- case CPDF_Object::BOOLEAN:
- case CPDF_Object::NUMBER:
+ case CPDF_Object::kBoolean:
+ case CPDF_Object::kNumber:
buf << " " << pObj->GetString();
break;
- case CPDF_Object::STRING:
+ case CPDF_Object::kString:
buf << PDF_EncodeString(pObj->GetString(), pObj->AsString()->IsHex());
break;
- case CPDF_Object::NAME: {
+ case CPDF_Object::kName: {
ByteString str = pObj->GetString();
buf << "/" << PDF_NameEncode(str);
break;
}
- case CPDF_Object::REFERENCE: {
+ case CPDF_Object::kReference: {
buf << " " << pObj->AsReference()->GetRefObjNum() << " 0 R ";
break;
}
- case CPDF_Object::ARRAY: {
+ case CPDF_Object::kArray: {
const CPDF_Array* p = pObj->AsArray();
buf << "[";
for (size_t i = 0; i < p->size(); i++) {
@@ -191,7 +191,7 @@ std::ostream& operator<<(std::ostream& buf, const CPDF_Object* pObj) {
buf << "]";
break;
}
- case CPDF_Object::DICTIONARY: {
+ case CPDF_Object::kDictionary: {
CPDF_DictionaryLocker locker(pObj->AsDictionary());
buf << "<<";
for (const auto& it : locker) {
@@ -207,7 +207,7 @@ std::ostream& operator<<(std::ostream& buf, const CPDF_Object* pObj) {
buf << ">>";
break;
}
- case CPDF_Object::STREAM: {
+ case CPDF_Object::kStream: {
const CPDF_Stream* p = pObj->AsStream();
buf << p->GetDict() << "stream\r\n";
auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(p);
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index 89030b4132..61cdf4c4a1 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -337,10 +337,10 @@ WideString CPDF_FormField::GetValue(bool bDefault) const {
}
switch (pValue->GetType()) {
- case CPDF_Object::STRING:
- case CPDF_Object::STREAM:
+ case CPDF_Object::kString:
+ case CPDF_Object::kStream:
return pValue->GetUnicodeText();
- case CPDF_Object::ARRAY:
+ case CPDF_Object::kArray:
pValue = pValue->AsArray()->GetDirectObjectAt(0);
if (pValue)
return pValue->GetUnicodeText();
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 2c8e68eca7..95730e5369 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -121,28 +121,31 @@ static_assert(static_cast<int>(CPDF_Annot::AppearanceMode::Down) ==
// These checks ensure the consistency of dictionary value types across core/
// and public/.
-static_assert(static_cast<int>(CPDF_Object::Type::BOOLEAN) ==
+static_assert(static_cast<int>(CPDF_Object::Type::kBoolean) ==
FPDF_OBJECT_BOOLEAN,
- "CPDF_Object::BOOLEAN value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::NUMBER) == FPDF_OBJECT_NUMBER,
- "CPDF_Object::NUMBER value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::STRING) == FPDF_OBJECT_STRING,
- "CPDF_Object::STRING value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::NAME) == FPDF_OBJECT_NAME,
- "CPDF_Object::NAME value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::ARRAY) == FPDF_OBJECT_ARRAY,
- "CPDF_Object::ARRAY value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::DICTIONARY) ==
+ "CPDF_Object::kBoolean value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kNumber) ==
+ FPDF_OBJECT_NUMBER,
+ "CPDF_Object::kNumber value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kString) ==
+ FPDF_OBJECT_STRING,
+ "CPDF_Object::kString value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kName) == FPDF_OBJECT_NAME,
+ "CPDF_Object::kName value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kArray) == FPDF_OBJECT_ARRAY,
+ "CPDF_Object::kArray value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kDictionary) ==
FPDF_OBJECT_DICTIONARY,
- "CPDF_Object::DICTIONARY value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::STREAM) == FPDF_OBJECT_STREAM,
- "CPDF_Object::STREAM value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::NULLOBJ) ==
+ "CPDF_Object::kDictionary value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kStream) ==
+ FPDF_OBJECT_STREAM,
+ "CPDF_Object::kStream value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kNullobj) ==
FPDF_OBJECT_NULLOBJ,
- "CPDF_Object::NULLOBJ value mismatch");
-static_assert(static_cast<int>(CPDF_Object::Type::REFERENCE) ==
+ "CPDF_Object::kNullobj value mismatch");
+static_assert(static_cast<int>(CPDF_Object::Type::kReference) ==
FPDF_OBJECT_REFERENCE,
- "CPDF_Object::REFERENCE value mismatch");
+ "CPDF_Object::kReference value mismatch");
bool HasAPStream(CPDF_Dictionary* pAnnotDict) {
return !!GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal);
diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp
index 5c5930e097..e313f4ad55 100644
--- a/fpdfsdk/fpdf_ppo.cpp
+++ b/fpdfsdk/fpdf_ppo.cpp
@@ -350,7 +350,7 @@ bool CPDF_PageOrganizer::PDFDocInit() {
bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
ObjectNumberMap* pObjNumberMap) {
switch (pObj->GetType()) {
- case CPDF_Object::REFERENCE: {
+ case CPDF_Object::kReference: {
CPDF_Reference* pReference = pObj->AsReference();
uint32_t newobjnum = GetNewObjId(pObjNumberMap, pReference);
if (newobjnum == 0)
@@ -358,7 +358,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
pReference->SetRef(dest(), newobjnum);
break;
}
- case CPDF_Object::DICTIONARY: {
+ case CPDF_Object::kDictionary: {
CPDF_Dictionary* pDict = pObj->AsDictionary();
std::vector<ByteString> bad_keys;
{
@@ -378,7 +378,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
pDict->RemoveFor(key);
break;
}
- case CPDF_Object::ARRAY: {
+ case CPDF_Object::kArray: {
CPDF_Array* pArray = pObj->AsArray();
for (size_t i = 0; i < pArray->size(); ++i) {
CPDF_Object* pNextObj = pArray->GetObjectAt(i);
@@ -389,7 +389,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
}
break;
}
- case CPDF_Object::STREAM: {
+ case CPDF_Object::kStream: {
CPDF_Stream* pStream = pObj->AsStream();
CPDF_Dictionary* pDict = pStream->GetDict();
if (!pDict)