Replace FPDF_PAGE_MAX_NUM with class scoped constant.

Also avoids confusion with unrelated FPDF_PAGE API type.

Bug: pdfium:1085
Change-Id: I36569573f020f0b87f13630bbab91caf351e4994
Reviewed-on: https://pdfium-review.googlesource.com/34830
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index 995d7ed..59927bc 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -95,7 +95,7 @@
 int CountPages(CPDF_Dictionary* pPages,
                std::set<CPDF_Dictionary*>* visited_pages) {
   int count = pPages->GetIntegerFor("Count");
-  if (count > 0 && count < FPDF_PAGE_MAX_NUM)
+  if (count > 0 && count < CPDF_Document::kPageMaxNum)
     return count;
   CPDF_Array* pKidList = pPages->GetArrayFor("Kids");
   if (!pKidList)
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index a34b25d..d196438 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -38,8 +38,6 @@
 #define FPDFPERM_FILL_FORM 0x0100
 #define FPDFPERM_EXTRACT_ACCESS 0x0200
 
-#define FPDF_PAGE_MAX_NUM 0xFFFFF
-
 class CPDF_Document : public CPDF_IndirectObjectHolder {
  public:
   // Type from which the XFA extension can subclass itself.
@@ -52,6 +50,8 @@
     virtual uint32_t GetUserPermissions() const = 0;
   };
 
+  static const int kPageMaxNum = 0xFFFFF;
+
   explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser);
   ~CPDF_Document() override;
 
diff --git a/core/fpdfapi/parser/cpdf_hint_tables.cpp b/core/fpdfapi/parser/cpdf_hint_tables.cpp
index 65beda7..a85fb2b 100644
--- a/core/fpdfapi/parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/parser/cpdf_hint_tables.cpp
@@ -132,7 +132,7 @@
   hStream->SkipBits(16);
 
   const uint32_t nPages = m_pLinearized->GetPageCount();
-  if (nPages < 1 || nPages >= FPDF_PAGE_MAX_NUM)
+  if (nPages < 1 || nPages >= CPDF_Document::kPageMaxNum)
     return false;
 
   const uint32_t dwPages = pdfium::base::checked_cast<uint32_t>(nPages);