diff options
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_boolean.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_boolean.h | 4 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp | 8 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp | 7 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_security_handler.h | 2 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h | 5 |
6 files changed, 14 insertions, 14 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_boolean.cpp b/core/fpdfapi/fpdf_parser/cpdf_boolean.cpp index cd7ed32a96..c5fd277d74 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_boolean.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_boolean.cpp @@ -8,7 +8,7 @@ CPDF_Boolean::CPDF_Boolean() : m_bValue(false) {} -CPDF_Boolean::CPDF_Boolean(FX_BOOL value) : m_bValue(value) {} +CPDF_Boolean::CPDF_Boolean(bool value) : m_bValue(value) {} CPDF_Boolean::~CPDF_Boolean() {} diff --git a/core/fpdfapi/fpdf_parser/cpdf_boolean.h b/core/fpdfapi/fpdf_parser/cpdf_boolean.h index c92bf41b86..adbb721f35 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_boolean.h +++ b/core/fpdfapi/fpdf_parser/cpdf_boolean.h @@ -14,7 +14,7 @@ class CPDF_Boolean : public CPDF_Object { public: CPDF_Boolean(); - explicit CPDF_Boolean(FX_BOOL value); + explicit CPDF_Boolean(bool value); // CPDF_Object. Type GetType() const override; @@ -29,7 +29,7 @@ class CPDF_Boolean : public CPDF_Object { protected: ~CPDF_Boolean() override; - FX_BOOL m_bValue; + bool m_bValue; }; #endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_BOOLEAN_H_ diff --git a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp index 27b866a65b..4ea8f438bd 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp @@ -96,10 +96,10 @@ FX_FLOAT CPDF_Dictionary::GetNumberBy(const CFX_ByteString& key) const { return p ? p->GetNumber() : 0; } -FX_BOOL CPDF_Dictionary::GetBooleanBy(const CFX_ByteString& key, - FX_BOOL bDefault) const { +bool CPDF_Dictionary::GetBooleanBy(const CFX_ByteString& key, + bool bDefault) const { CPDF_Object* p = GetObjectBy(key); - return ToBoolean(p) ? p->GetInteger() : bDefault; + return ToBoolean(p) ? p->GetInteger() != 0 : bDefault; } CPDF_Dictionary* CPDF_Dictionary::GetDictBy(const CFX_ByteString& key) const { @@ -224,7 +224,7 @@ void CPDF_Dictionary::SetAtNumber(const CFX_ByteString& key, FX_FLOAT f) { SetAt(key, new CPDF_Number(f)); } -void CPDF_Dictionary::SetAtBoolean(const CFX_ByteString& key, FX_BOOL bValue) { +void CPDF_Dictionary::SetAtBoolean(const CFX_ByteString& key, bool bValue) { SetAt(key, new CPDF_Boolean(bValue)); } diff --git a/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp index 94ef042bc0..054266765a 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp @@ -512,8 +512,9 @@ FX_BOOL CPDF_SecurityHandler::CheckOwnerPassword(const uint8_t* password, return CheckUserPassword(user_pass.raw_str(), user_pass.GetLength(), TRUE, key, key_len); } -FX_BOOL CPDF_SecurityHandler::IsMetadataEncrypted() { - return m_pEncryptDict->GetBooleanBy("EncryptMetadata", TRUE); + +bool CPDF_SecurityHandler::IsMetadataEncrypted() const { + return m_pEncryptDict->GetBooleanBy("EncryptMetadata", true); } void CPDF_SecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, @@ -545,7 +546,7 @@ void CPDF_SecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, AES256_SetPassword(pEncryptDict, owner_pass, owner_size, TRUE, m_EncryptKey); AES256_SetPerms(pEncryptDict, m_Permissions, - pEncryptDict->GetBooleanBy("EncryptMetadata", TRUE), + pEncryptDict->GetBooleanBy("EncryptMetadata", true), m_EncryptKey); } return; diff --git a/core/fpdfapi/fpdf_parser/cpdf_security_handler.h b/core/fpdfapi/fpdf_parser/cpdf_security_handler.h index d342c1484e..3cf4d2cd19 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_security_handler.h +++ b/core/fpdfapi/fpdf_parser/cpdf_security_handler.h @@ -30,7 +30,7 @@ class CPDF_SecurityHandler { FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict); uint32_t GetPermissions(); FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen); - FX_BOOL IsMetadataEncrypted(); + bool IsMetadataEncrypted() const; CPDF_CryptoHandler* CreateCryptoHandler(); void OnCreate(CPDF_Dictionary* pEncryptDict, diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h index e3b7496da7..41cec0cda2 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h @@ -39,8 +39,7 @@ class CPDF_Dictionary : public CPDF_Object { CFX_WideString GetUnicodeTextBy(const CFX_ByteString& key) const; int GetIntegerBy(const CFX_ByteString& key) const; int GetIntegerBy(const CFX_ByteString& key, int default_int) const; - FX_BOOL GetBooleanBy(const CFX_ByteString& key, - FX_BOOL bDefault = FALSE) const; + bool GetBooleanBy(const CFX_ByteString& key, bool bDefault = false) const; FX_FLOAT GetNumberBy(const CFX_ByteString& key) const; CPDF_Dictionary* GetDictBy(const CFX_ByteString& key) const; CPDF_Stream* GetStreamBy(const CFX_ByteString& key) const; @@ -70,7 +69,7 @@ class CPDF_Dictionary : public CPDF_Object { } void SetAtRect(const CFX_ByteString& key, const CFX_FloatRect& rect); void SetAtMatrix(const CFX_ByteString& key, const CFX_Matrix& matrix); - void SetAtBoolean(const CFX_ByteString& key, FX_BOOL bValue); + void SetAtBoolean(const CFX_ByteString& key, bool bValue); void AddReference(const CFX_ByteString& key, CPDF_IndirectObjectHolder* pDoc, |