From 8d2aae7ee320da3a8ffe01c57e38b3f98443257d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Jul 2015 12:08:12 -0700 Subject: Revert "FX Bool considered harmful, part 3" This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 . --- fpdfsdk/src/fsdk_actionhandler.cpp | 136 ++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'fpdfsdk/src/fsdk_actionhandler.cpp') diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp index 7ba227f0c2..145559e057 100644 --- a/fpdfsdk/src/fsdk_actionhandler.cpp +++ b/fpdfsdk/src/fsdk_actionhandler.cpp @@ -24,14 +24,14 @@ void CPDFSDK_ActionHandler::SetMediaActionHandler(CPDFSDK_MediaActionHandler* pH } //document open -bool CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument) { CFX_PtrList list; return ExecuteDocumentOpenAction(action, pDocument, list); } //document open -bool CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, +FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, CPDFSDK_Document* pDocument) { if (JsAction.GetType() == CPDF_Action::JavaScript) @@ -40,14 +40,14 @@ bool CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_ if (!swJS.IsEmpty()) { RunDocumentOpenJavaScript(pDocument, csJSName, swJS); - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type, +FX_BOOL CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data) { @@ -59,48 +59,48 @@ bool CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction if (!swJS.IsEmpty()) { RunFieldJavaScript(pDocument, pFormField, type, data, swJS); - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, +FX_BOOL CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument) { CFX_PtrList list; return ExecuteDocumentPageAction(action, eType, pDocument, list); } -bool CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, +FX_BOOL CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument) { CFX_PtrList list; return ExecuteDocumentPageAction(action, eType, pDocument, list); } -bool CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, +FX_BOOL CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument) { CFX_PtrList list; return ExecuteBookMark(action, pDocument, pBookMark, list); } -bool CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, +FX_BOOL CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen) { CFX_PtrList list; return ExecuteScreenAction(action, type, pDocument, pScreen, list); } -bool CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action, +FX_BOOL CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument) { CFX_PtrList list; return ExecuteLinkAction(action, pDocument, list); } -bool CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, +FX_BOOL CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data) { @@ -108,12 +108,12 @@ bool CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AActi return ExecuteFieldAction(action, type, pDocument, pFormField, data, list); } -bool CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, +FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, CFX_PtrList& list) { CPDF_Dictionary* pDict = action.GetDict(); if (list.Find(pDict)) - return false; + return FALSE; list.AddTail(pDict); @@ -138,20 +138,20 @@ bool CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, for (int32_t i=0,sz=action.GetSubActionsCount(); iOnLink_MouseUp(pDocument); CFX_WideString csInfo; - bool bRet = pContext->RunScript(swJS, csInfo); + FX_BOOL bRet = pContext->RunScript(swJS, csInfo); if (!bRet) { // FIXME: return error. @@ -193,20 +193,20 @@ bool CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK for (int32_t i=0,sz=action.GetSubActionsCount(); iGetFieldByDict(pFieldDict) != NULL; } -bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type, +FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data, CFX_PtrList& list) { @@ -262,7 +262,7 @@ bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_A CPDF_Dictionary* pDict = action.GetDict(); if (list.Find(pDict)) - return false; + return FALSE; list.AddTail(pDict); @@ -277,7 +277,7 @@ bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_A { RunFieldJavaScript(pDocument, pFormField, type, data, swJS); if (!IsValidField(pDocument, pFormField->GetFieldDict())) - return false; + return FALSE; } } } @@ -289,20 +289,20 @@ bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_A for (int32_t i=0,sz=action.GetSubActionsCount(); iOnScreen_OutView(IsCTRLpressed(), IsSHIFTpressed(), pScreen); // break; // default: - // ASSERT(false); + // ASSERT(FALSE); // break; // } CFX_WideString csInfo; - bool bRet = pContext->RunScript(swJS, csInfo); + FX_BOOL bRet = pContext->RunScript(swJS, csInfo); if (!bRet) { //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo); @@ -379,20 +379,20 @@ bool CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_ for (int32_t i=0,sz=action.GetSubActionsCount(); iOnBookmark_MouseUp(pBookmark); CFX_WideString csInfo; - bool bRet = pContext->RunScript(swJS, csInfo); + FX_BOOL bRet = pContext->RunScript(swJS, csInfo); if (!bRet) { //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo); @@ -434,10 +434,10 @@ bool CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_D for (int32_t i=0,sz=action.GetSubActionsCount(); iRunScript(script, csInfo); + FX_BOOL bRet = pContext->RunScript(script, csInfo); if (!bRet) { //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo); @@ -668,7 +668,7 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(CPDFSDK_Document* pDocumen pContext->OnDoc_Open(pDocument, sScriptName); CFX_WideString csInfo; - bool bRet = pContext->RunScript(script, csInfo); + FX_BOOL bRet = pContext->RunScript(script, csInfo); if (!bRet) { //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo); @@ -719,12 +719,12 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocumen pContext->OnPage_OutView(pDocument); break; default: - ASSERT(false); + ASSERT(FALSE); break; } CFX_WideString csInfo; - bool bRet = pContext->RunScript(script, csInfo); + FX_BOOL bRet = pContext->RunScript(script, csInfo); if (!bRet) { //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo); @@ -734,7 +734,7 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocumen } -bool CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); @@ -744,13 +744,13 @@ bool CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK if (pInterForm->DoAction_Hide(action)) { pDocument->SetChangeMark(); - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); @@ -760,7 +760,7 @@ bool CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, C return pInterForm->DoAction_SubmitForm(action); } -bool CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); @@ -769,13 +769,13 @@ bool CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CP if (pInterForm->DoAction_ResetForm(action)) { - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); @@ -785,23 +785,23 @@ bool CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, C if (pInterForm->DoAction_ImportData(action)) { pDocument->SetChangeMark(); - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -bool CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -bool CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument) +FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -- cgit v1.2.3