Chromium Code Reviews| Index: core/fpdfapi/fpdf_parser/cpdf_document.cpp |
| diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp |
| index 13d9737b5b134a79d327b0b597554c8221e9b7b4..7833c5d60b856aceb03d5765dd2593aa333d622a 100644 |
| --- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp |
| +++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp |
| @@ -718,9 +718,15 @@ int CPDF_Document::RetrievePageCount() const { |
| return CountPages(pPages, &visited_pages); |
| } |
| -uint32_t CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const { |
| - return m_pParser ? m_pParser->GetPermissions(bCheckRevision) |
| - : static_cast<uint32_t>(-1); |
| +uint32_t CPDF_Document::GetUserPermissions() const { |
| + if (!m_pParser) { |
| +#ifndef PDF_ENABLE_XFA |
| + return 0; |
| +#else // PDF_ENABLE_XFA |
| + return 0xFFFFFFFF; |
|
Tom Sepez
2016/05/23 16:30:26
This has always bothered me. I suspect the 0 is w
Lei Zhang
2016/05/23 18:41:24
This is carried over from FPDF_GetDocPermissions()
|
| +#endif |
| + } |
| + return m_pParser->GetPermissions(); |
| } |
| FX_BOOL CPDF_Document::IsFormStream(uint32_t objnum, FX_BOOL& bForm) const { |