Make empty document always have empty privileges

This landed earlier as part of a larger change that got reverted for
unrelated reasons. Now re-land it by itself. See
  https://pdfium-review.googlesource.com/c/pdfium/+/33370

If we don't have a document, then we can't dynamically tell if it is
an XFA doc, so there's no reason to believe it should have all permissions.
If there is an XFA doc under the covers, then the extension will give
us the value.

Change-Id: I6e007ab659914c39d2e5f3fe7a25d9d13439d358
Reviewed-on: https://pdfium-review.googlesource.com/34932
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 535f1e5..cbbfd9c 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -308,16 +308,7 @@
 FPDF_EXPORT unsigned long FPDF_CALLCONV
 FPDF_GetDocPermissions(FPDF_DOCUMENT document) {
   CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
-  // https://bugs.chromium.org/p/pdfium/issues/detail?id=499
-  if (!pDoc) {
-#ifndef PDF_ENABLE_XFA
-    return 0;
-#else   // PDF_ENABLE_XFA
-    return 0xFFFFFFFF;
-#endif  // PDF_ENABLE_XFA
-  }
-
-  return pDoc->GetUserPermissions();
+  return pDoc ? pDoc->GetUserPermissions() : 0;
 }
 
 FPDF_EXPORT int FPDF_CALLCONV