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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_document.cpp

Issue 2005653002: Distinguish between user and owner passwords. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: fix bug Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698