Clean up FPDF_GetFormType().

- Update public API documentation.
- Fix nits in the implementation.

Change-Id: I4c7af07b0ec178a5986f45652663f48491b7d078
Reviewed-on: https://pdfium-review.googlesource.com/24330
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 97fc02a..e890aa0 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -574,9 +574,6 @@
 }
 
 FPDF_EXPORT int FPDF_CALLCONV FPDF_GetFormType(FPDF_DOCUMENT document) {
-  if (!document)
-    return false;
-
   const CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
   if (!pDoc)
     return FORMTYPE_NONE;
@@ -593,8 +590,8 @@
   if (!pXFA)
     return FORMTYPE_ACRO_FORM;
 
-  bool needsRendering = pRoot->GetBooleanFor("NeedsRendering", false);
-  return needsRendering ? FORMTYPE_XFA_FULL : FORMTYPE_XFA_FOREGROUND;
+  bool bNeedsRendering = pRoot->GetBooleanFor("NeedsRendering", false);
+  return bNeedsRendering ? FORMTYPE_XFA_FULL : FORMTYPE_XFA_FOREGROUND;
 }
 
 #ifdef PDF_ENABLE_XFA
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index c2e2bd5..81c0ea2 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -14,12 +14,13 @@
 
 // These values are return values for a public API, so should not be changed
 // other than the count when adding new values.
-#define FORMTYPE_NONE 0       // Document contains no forms
-#define FORMTYPE_ACRO_FORM 1  // Forms are specified using AcroForm spec
-#define FORMTYPE_XFA_FULL 2   // Forms are specified using the entire XFA spec
-#define FORMTYPE_XFA_FOREGROUND \
-  3  // Forms are specified using the XFAF subset of XFA spec
-#define FORMTYPE_COUNT 4  // The number of form types
+#define FORMTYPE_NONE 0            // Document contains no forms
+#define FORMTYPE_ACRO_FORM 1       // Forms are specified using AcroForm spec
+#define FORMTYPE_XFA_FULL 2        // Forms are specified using the entire XFA
+                                   // spec
+#define FORMTYPE_XFA_FOREGROUND 3  // Forms are specified using the XFAF subset
+                                   // of XFA spec
+#define FORMTYPE_COUNT 4           // The number of form types
 
 // Exported Functions
 #ifdef __cplusplus
@@ -1640,15 +1641,13 @@
 /**
  * Experimental API
  * Function: FPDF_GetFormType
- *                      Returns the type of form contained in the PDF document.
+ *           Returns the type of form contained in the PDF document.
  * Parameters:
- *                      document                -       Handle to document.
- *Returned by FPDF_LoadDocument function.
- *                      docType                 -       Document type defined as
- *FORMTYPE_xxx.
+ *           document - Handle to document.
  * Return Value:
- *                      Integer value representing one of the FORMTYPE_xxx
- *values.
+ *           Integer value representing one of the FORMTYPE_ values.
+ * Comments:
+ *           If |document| is NULL, then the return value is FORMTYPE_NONE.
  **/
 FPDF_EXPORT int FPDF_CALLCONV FPDF_GetFormType(FPDF_DOCUMENT document);