XFA: clang-format all pdfium code, again.

Also add a presubmit that checks for this so I don't have to keep doing it.
No behavior change.

Generated by:
  find . -name '*.cpp' -o -name '*.h' | \
  grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \
  xargs ../../buildtools/mac/clang-format -i
Then manually merged https://codereview.chromium.org/1269223002/

See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.

BUG=none
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1277043002 .
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index 089a34c..2abafca 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -50,18 +50,18 @@
     bRC = TRUE;
   }
 
-  FX_BOOL bModifier;  // in
-  FX_BOOL bShift;  // in
-  int nCommitKey;  // in
-  CFX_WideString sChange;  // in[out]
+  FX_BOOL bModifier;         // in
+  FX_BOOL bShift;            // in
+  int nCommitKey;            // in
+  CFX_WideString sChange;    // in[out]
   CFX_WideString sChangeEx;  // in
-  FX_BOOL bKeyDown;  // in
-  int nSelEnd;  // in[out]
-  int nSelStart;  // in[out]
-  CFX_WideString sValue;  // in[out]
-  FX_BOOL bWillCommit;  // in
-  FX_BOOL bFieldFull;  // in
-  FX_BOOL bRC;  // in[out]
+  FX_BOOL bKeyDown;          // in
+  int nSelEnd;               // in[out]
+  int nSelStart;             // in[out]
+  CFX_WideString sValue;     // in[out]
+  FX_BOOL bWillCommit;       // in
+  FX_BOOL bFieldFull;        // in
+  FX_BOOL bRC;               // in[out]
 } PDFSDK_FieldAction;
 class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
  public:
diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h
index 4aa3568..8c5584a 100644
--- a/fpdfsdk/include/fxedit/fxet_list.h
+++ b/fpdfsdk/include/fxedit/fxet_list.h
@@ -339,10 +339,10 @@
   FX_BOOL m_bNotifyFlag;
   CPDF_Point m_ptScrollPos;
   CPLST_Select m_aSelItems;  // for multiple
-  int32_t m_nSelItem;  // for single
-  int32_t m_nFootIndex;  // for multiple
-  FX_BOOL m_bCtrlSel;  // for multiple
-  int32_t m_nCaretIndex;  // for multiple
+  int32_t m_nSelItem;        // for single
+  int32_t m_nFootIndex;      // for multiple
+  FX_BOOL m_bCtrlSel;        // for multiple
+  int32_t m_nCaretIndex;     // for multiple
 };
 
 #endif  // FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_
diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h
index 11471af..17bf7b1 100644
--- a/fpdfsdk/include/javascript/JS_Define.h
+++ b/fpdfsdk/include/javascript/JS_Define.h
@@ -37,10 +37,10 @@
 #define BEGIN_JS_STATIC_CONST(js_class_name) \
   JSConstSpec js_class_name::JS_Class_Consts[] = {
 #define JS_STATIC_CONST_ENTRY_NUMBER(const_name, pValue) \
-  { const_name, pValue, L"", 0 }          \
+  { const_name, pValue, L"", 0 }                         \
   ,
-#define JS_STATIC_CONST_ENTRY_STRING(const_name, pValue)     \
-  { const_name, 0, pValue, 1 } \
+#define JS_STATIC_CONST_ENTRY_STRING(const_name, pValue) \
+  { const_name, 0, pValue, 1 }                           \
   ,
 #define END_JS_STATIC_CONST() \
   { 0, 0, 0, 0 }              \
@@ -190,8 +190,8 @@
   const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);      \
   void js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,         \
                                     JSFXObject global) {                       \
-    CJS_Object* pObj = new js_class_name(obj);                              \
-    pObj->SetEmbedObject(new class_alternate(pObj));                        \
+    CJS_Object* pObj = new js_class_name(obj);                                 \
+    pObj->SetEmbedObject(new class_alternate(pObj));                           \
     JS_SetPrivate(NULL, obj, (void*)pObj);                                     \
     pObj->InitInstance(cc);                                                    \
   }                                                                            \
@@ -398,8 +398,8 @@
   }                                                                            \
   void js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,         \
                                     JSFXObject global) {                       \
-    CJS_Object* pObj = new js_class_name(obj);                              \
-    pObj->SetEmbedObject(new class_alternate(pObj));                        \
+    CJS_Object* pObj = new js_class_name(obj);                                 \
+    pObj->SetEmbedObject(new class_alternate(pObj));                           \
     JS_SetPrivate(NULL, obj, (void*)pObj);                                     \
     pObj->InitInstance(cc);                                                    \
   }                                                                            \
diff --git a/fpdfsdk/include/javascript/app.h b/fpdfsdk/include/javascript/app.h
index 221a7c1..b131213 100644
--- a/fpdfsdk/include/javascript/app.h
+++ b/fpdfsdk/include/javascript/app.h
@@ -36,71 +36,6 @@
   DECLARE_JS_CLASS(CJS_TimerObj);
 };
 
-// struct APP_MENUITEM_ARRAY;
-//
-// struct APP_MENUITEM
-// {
-// 	APP_MENUITEM() : oSubMenu(NULL), cName(L""), cReturn(L""),
-// bMarked(false), bEnabled(true)
-// 	{
-// 	}
-// 	CFX_WideString cName;
-// 	CFX_WideString cReturn;
-// 	APP_MENUITEM_ARRAY* oSubMenu;
-// 	bool bMarked;
-// 	bool bEnabled;
-// };
-
-// struct APP_MENUITEM_ARRAY
-// {
-// 	APP_MENUITEM_ARRAY() : m_hMenu(NULL), pContents(NULL), nSize(0)
-// 	{
-//
-// 	}
-// 	APP_MENUITEM * pContents;
-// 	HMENU m_hMenu;
-// 	int	nSize;
-// };
-
-// struct APP_MENU;
-// struct APP_MENU_ARRAY
-// {
-// 	APP_MENU_ARRAY():
-//     pContent(NULL)
-// 	{
-// 	}
-//
-// 	APP_MENU* pContent;
-// };
-
-// struct APP_MENU
-// {
-// 	APP_MENU():bSubMenu(false),
-// 	SubMenuItems(NULL),
-// 	cwMenuItemName(L""),
-// 	hMenu(NULL),
-// 	iSize(0)
-// 	{
-//
-// 	}
-//
-// 	APP_MENU(CFX_WideString &cwName):
-// 	cwMenuItemName(cwName),
-// 	bSubMenu(false),
-// 	SubMenuItems(NULL),
-// 	hMenu(NULL),
-// 	iSize(0)
-// 	{
-//
-// 	}
-//
-// 	CFX_WideString cwMenuItemName;
-// 	bool bSubMenu;
-// 	APP_MENU_ARRAY* SubMenuItems;
-// 	int iSize;
-// 	HMENU hMenu;
-// };
-
 class app : public CJS_EmbedObj {
  public:
   app(CJS_Object* pJSObject);
@@ -226,25 +161,8 @@
                      CFX_WideString& sError);
 
  private:
-  //	FX_DWORD					AppGetTickCount();
   void TimerProc(CJS_Timer* pTimer);
   void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript);
-  //	void						ParsePopupMenuObj(APP_MENUITEM *
-  //ppMenuItem,JSObject * pObj);
-  //	void						DeleteMenuItems(APP_MENUITEM_ARRAY *
-  //pMenuItems);
-  // 	void						AddMenuItem(APP_MENUITEM_ARRAY * pMenuItems, HMENU
-  // hMenu, MENUITEMINFO MenuItemInfo);
-  // 	void						InitMenuItemInfo(MENUITEMINFO&
-  // MenuItemInfo);
-  // 	void						DestroyPopUpMenu();
-
-  // 	void						ParserMenuItem(APP_MENU* pHead, const
-  // CJS_Parameters&params);
-  // 	void						AddItemToMenu(APP_MENU* pHead, HMENU hMenu,
-  // MENUITEMINFO MenuItemInfo);
-  // 	void						DestroyMenuItems(APP_MENU*
-  // pHead);
 
  public:
   static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath);
@@ -254,10 +172,6 @@
   bool m_bRuntimeHighLight;
 
   CFX_ArrayTemplate<CJS_Timer*> m_aTimer;
-  //	APP_MENU*					m_pMenuHead;
-
- public:
-  //	static CReader_App* s_App;
 };
 
 class CJS_App : public CJS_Object {
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index 235786b..29c49fb 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -226,28 +226,28 @@
         eCursorType(FXCT_ARROW),
         mtChild(1, 0, 0, 1, 0, 0) {}
 
-  CPDF_Rect rcRectWnd;  // required
+  CPDF_Rect rcRectWnd;                // required
   IFX_SystemHandler* pSystemHandler;  // required
-  IFX_Edit_FontMap* pFontMap;  // required for text window
-  IPWL_Provider* pProvider;  // required for self coordinate
-  IPWL_FocusHandler* pFocusHandler;  // optional
-  FX_DWORD dwFlags;  // optional
-  CPWL_Color sBackgroundColor;  // optional
-  FX_HWND hAttachedWnd;  // required for no-reader framework
-  IPWL_SpellCheck* pSpellCheck;  // required for spellchecking
-  int32_t nBorderStyle;  // optional
-  int32_t dwBorderWidth;  // optional
-  CPWL_Color sBorderColor;  // optional
-  CPWL_Color sTextColor;  // optional
-  CPWL_Color sTextStrokeColor;  // optional
-  int32_t nTransparency;  // optional
-  FX_FLOAT fFontSize;  // optional
-  CPWL_Dash sDash;  // optional
-  void* pAttachedData;  // optional
-  CPWL_Wnd* pParentWnd;  // ignore
-  CPWL_MsgControl* pMsgControl;  // ignore
-  int32_t eCursorType;  // ignore
-  CPDF_Matrix mtChild;  // ignore
+  IFX_Edit_FontMap* pFontMap;         // required for text window
+  IPWL_Provider* pProvider;           // required for self coordinate
+  IPWL_FocusHandler* pFocusHandler;   // optional
+  FX_DWORD dwFlags;                   // optional
+  CPWL_Color sBackgroundColor;        // optional
+  FX_HWND hAttachedWnd;               // required for no-reader framework
+  IPWL_SpellCheck* pSpellCheck;       // required for spellchecking
+  int32_t nBorderStyle;               // optional
+  int32_t dwBorderWidth;              // optional
+  CPWL_Color sBorderColor;            // optional
+  CPWL_Color sTextColor;              // optional
+  CPWL_Color sTextStrokeColor;        // optional
+  int32_t nTransparency;              // optional
+  FX_FLOAT fFontSize;                 // optional
+  CPWL_Dash sDash;                    // optional
+  void* pAttachedData;                // optional
+  CPWL_Wnd* pParentWnd;               // ignore
+  CPWL_MsgControl* pMsgControl;       // ignore
+  int32_t eCursorType;                // ignore
+  CPDF_Matrix mtChild;                // ignore
 };
 
 class CPWL_Timer {
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index e48c6ab..3049384 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -196,8 +196,7 @@
   if (!pContentsObj) {
     // Create a new contents dictionary
     if (!key.IsEmpty()) {
-      CPDF_Stream* pNewContents =
-          new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
+      CPDF_Stream* pNewContents = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
       if (!pNewContents)
         return;
       pPage->SetAtReference("Contents", pDocument,
@@ -246,8 +245,7 @@
   pPage->SetAtReference("Contents", pDocument, dwObjNum);
 
   if (!key.IsEmpty()) {
-    CPDF_Stream* pNewContents =
-        new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
+    CPDF_Stream* pNewContents = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
     dwObjNum = pDocument->AddIndirectObject(pNewContents);
     pContentsArray->AddReference(pDocument, dwObjNum);
 
@@ -391,8 +389,7 @@
     pPageDict->SetAt("Resources", pRes);
   }
 
-  CPDF_Stream* pNewXObject =
-      new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
+  CPDF_Stream* pNewXObject = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
   FX_DWORD dwObjNum = pDocument->AddIndirectObject(pNewXObject);
   CPDF_Dictionary* pPageXObject = pRes->GetDict("XObject");
   if (!pPageXObject) {
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index aa08f68..6e72431 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -151,8 +151,7 @@
     if (pDirectObj != NULL) {
       if (pDirectObj->GetType() == PDFOBJ_ARRAY) {
         pContentArray = (CPDF_Array*)pDirectObj;
-        CPDF_Reference* pRef =
-            new CPDF_Reference(pDoc, pStream->GetObjNum());
+        CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum());
         pContentArray->InsertAt(0, pRef);
         pContentArray->AddReference(pDoc, pEndStream);
 
@@ -324,8 +323,7 @@
     if (pDirectObj != NULL) {
       if (pDirectObj->GetType() == PDFOBJ_ARRAY) {
         pContentArray = (CPDF_Array*)pDirectObj;
-        CPDF_Reference* pRef =
-            new CPDF_Reference(pDoc, pStream->GetObjNum());
+        CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum());
         pContentArray->InsertAt(0, pRef);
 
       } else if (pDirectObj->GetType() == PDFOBJ_STREAM) {
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp
index f839d2c..170a2dd 100644
--- a/fpdfsdk/src/fpdfeditimg.cpp
+++ b/fpdfsdk/src/fpdfeditimg.cpp
@@ -14,8 +14,7 @@
   if (!document)
     return NULL;
   CPDF_ImageObject* pImageObj = new CPDF_ImageObject;
-  CPDF_Image* pImg =
-      new CPDF_Image(((CPDFXFA_Document*)document)->GetPDFDoc());
+  CPDF_Image* pImg = new CPDF_Image(((CPDFXFA_Document*)document)->GetPDFDoc());
   pImageObj->m_pImage = pImg;
   return pImageObj;
 }
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index a308f17..87b23c3 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -237,7 +237,6 @@
   return FSDK_SetSandBoxPolicy(policy, enable);
 }
 
-
 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
                                                   FPDF_BYTESTRING password) {
   // NOTE: the creation of the file needs to be by the embedder on the
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
index be3b235..9378735 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
@@ -546,7 +546,8 @@
   CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();

 

   if (dwEvent == XFA_WIDGETEVENT_PostAdded) {

-    // 			CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(hWidget,

+    // 			CPDFSDK_Annot* pAnnot =

+    // pAnnotHandlerMgr->NewAnnot(hWidget,

     // pSdkPageView);

     // 			pAnnotHandlerMgr->Annot_OnLoad(pAnnot);

 

diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp
index a729fb7..55d4629 100644
--- a/fpdfsdk/src/fsdk_annothandler.cpp
+++ b/fpdfsdk/src/fsdk_annothandler.cpp
@@ -742,7 +742,7 @@
 // CPDFSDK_XFAAnnotHandler
 
 #define FWL_WGTHITTEST_Unknown 0
-#define FWL_WGTHITTEST_Client 1  // arrow
+#define FWL_WGTHITTEST_Client 1     // arrow
 #define FWL_WGTHITTEST_Titlebar 11  // caption
 #define FWL_WGTHITTEST_HScrollBar 15
 #define FWL_WGTHITTEST_VScrollBar 16
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index d06fcc0..b153ceb 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -1126,10 +1126,7 @@
   ASSERT(pDoc != NULL);
   CPDFDoc_Environment* pEnv = pDoc->GetEnv();
 
-  CBA_FontMap FontMap(
-      this,
-      pEnv->GetSysHandler());  //,
-                               //ISystemHandle::GetSystemHandler(m_pBaseForm->GetEnv()));
+  CBA_FontMap FontMap(this, pEnv->GetSysHandler());
   FontMap.Initial();
 
   FontMap.SetAPType("N");
@@ -1689,10 +1686,7 @@
     ASSERT(pDoc != NULL);
     CPDFDoc_Environment* pEnv = pDoc->GetEnv();
 
-    CBA_FontMap FontMap(
-        this,
-        pEnv->GetSysHandler());  //,
-                                 //ISystemHandle::GetSystemHandler(m_pBaseForm->GetEnv()));
+    CBA_FontMap FontMap(this, pEnv->GetSysHandler());
     FontMap.Initial();
     pEdit->SetFontMap(&FontMap);
 
diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp
index b9900d8..4e92099 100644
--- a/fpdfsdk/src/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/src/fxedit/fxet_ap.cpp
@@ -196,11 +196,6 @@
         CPVT_Word word;
         CPVT_Line line;
         if (pIterator->GetWord(word) && pIterator->GetLine(line)) {
-          // CPDF_Rect rcWordSel = CPDF_Rect(word.ptWord.x,line.ptLine.y +
-          // line.fLineDescent,
-          //		word.ptWord.x+word.fWidth,line.ptLine.y +
-          //line.fLineAscent);
-
           sRet << word.ptWord.x + ptOffset.x << " "
                << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " "
                << line.fLineAscent - line.fLineDescent << " re\nf\n";
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index ed1a7ca..136b544 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -308,10 +308,10 @@
           CJS_Value* pValue = new CJS_Value(isolate);
           //					if (iLenth == 1)
           //						pValue = new
-          //CJS_Value(isolate);
+          // CJS_Value(isolate);
           //					else if (iLenth > 1)
           //						pValue = new
-          //CJS_Value[iLenth];
+          // CJS_Value[iLenth];
 
           for (int i = 0; i < iLenth; i++) {
             carray.GetElement(i, *pValue);
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index 760702e..d0e8e6e 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -88,8 +88,8 @@
     pArray = new CFX_PtrArray();
     isolate->SetData(g_embedderDataSlot, pArray);
   }
-  CJS_ObjDefintion* pObjDef = new CJS_ObjDefintion(
-      isolate, sObjName, eObjType, pConstructor, pDestructor);
+  CJS_ObjDefintion* pObjDef = new CJS_ObjDefintion(isolate, sObjName, eObjType,
+                                                   pConstructor, pDestructor);
   pArray->Add(pObjDef);
   return pArray->GetSize() - 1;
 }
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index ba75e55..b252bff 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -183,7 +183,7 @@
 
       if (m_pList->IsItemSelected(i)) {
         //	CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem,
-        //ArgbEncode(255,0,51,113));
+        // ArgbEncode(255,0,51,113));
         IFX_SystemHandler* pSysHandler = GetSystemHandler();
         if (pSysHandler && pSysHandler->IsSelectionImplemented()) {
           IFX_Edit::DrawEdit(