From 9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 4 Aug 2015 13:00:21 -0700 Subject: XFA: clang-format all pdfium code. 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 --- fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp | 91 +++++++++++++++++------------------- 1 file changed, 44 insertions(+), 47 deletions(-) (limited to 'fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp') diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp index ac5ef21f58..3e1eedf8ea 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/fsdk_define.h" @@ -10,59 +10,56 @@ CFX_PtrArray CXFA_FWLAdapterTimerMgr::ms_timerArray; -FWL_ERR CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer *pTimer, FX_DWORD dwElapse, FWL_HTIMER &hTimer, FX_BOOL bImmediately /* = TRUE */) -{ - if (m_pEnv) - { - uint32_t uIDEvent = m_pEnv->FFI_SetTimer(dwElapse, TimerProc); - CFWL_TimerInfo *pInfo = FX_NEW CFWL_TimerInfo; - pInfo->uIDEvent = uIDEvent; - pInfo->pTimer = pTimer; - ms_timerArray.Add(pInfo); +FWL_ERR CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer, + FX_DWORD dwElapse, + FWL_HTIMER& hTimer, + FX_BOOL bImmediately /* = TRUE */) { + if (m_pEnv) { + uint32_t uIDEvent = m_pEnv->FFI_SetTimer(dwElapse, TimerProc); + CFWL_TimerInfo* pInfo = FX_NEW CFWL_TimerInfo; + pInfo->uIDEvent = uIDEvent; + pInfo->pTimer = pTimer; + ms_timerArray.Add(pInfo); + + hTimer = (FWL_HTIMER)pInfo; + return FWL_ERR_Succeeded; + } - hTimer = (FWL_HTIMER)pInfo; - return FWL_ERR_Succeeded; - } - - return FWL_ERR_Indefinite; + return FWL_ERR_Indefinite; } -FWL_ERR CXFA_FWLAdapterTimerMgr::Stop(FWL_HTIMER hTimer) -{ - if (!hTimer) return FWL_ERR_Indefinite; +FWL_ERR CXFA_FWLAdapterTimerMgr::Stop(FWL_HTIMER hTimer) { + if (!hTimer) + return FWL_ERR_Indefinite; - if (m_pEnv) - { - CFWL_TimerInfo *pInfo = (CFWL_TimerInfo*)hTimer; + if (m_pEnv) { + CFWL_TimerInfo* pInfo = (CFWL_TimerInfo*)hTimer; - m_pEnv->FFI_KillTimer(pInfo->uIDEvent); + m_pEnv->FFI_KillTimer(pInfo->uIDEvent); - int32_t index = ms_timerArray.Find(pInfo); - if (index >= 0) - { - ms_timerArray.RemoveAt(index); - delete pInfo; - } - return FWL_ERR_Succeeded; - } + int32_t index = ms_timerArray.Find(pInfo); + if (index >= 0) { + ms_timerArray.RemoveAt(index); + delete pInfo; + } + return FWL_ERR_Succeeded; + } - return FWL_ERR_Indefinite; + return FWL_ERR_Indefinite; } -void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) -{ - CFWL_TimerInfo *pInfo = NULL; - int32_t iCount = CXFA_FWLAdapterTimerMgr::ms_timerArray.GetSize(); - for (int32_t i = 0; i < iCount; i++) - { - CFWL_TimerInfo *pTemp = (CFWL_TimerInfo*)CXFA_FWLAdapterTimerMgr::ms_timerArray.GetAt(i); - if (pTemp->uIDEvent == idEvent) - { - pInfo = pTemp; break; - } - } - if (pInfo) - { - pInfo->pTimer->Run((FWL_HTIMER)pInfo); - } +void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) { + CFWL_TimerInfo* pInfo = NULL; + int32_t iCount = CXFA_FWLAdapterTimerMgr::ms_timerArray.GetSize(); + for (int32_t i = 0; i < iCount; i++) { + CFWL_TimerInfo* pTemp = + (CFWL_TimerInfo*)CXFA_FWLAdapterTimerMgr::ms_timerArray.GetAt(i); + if (pTemp->uIDEvent == idEvent) { + pInfo = pTemp; + break; + } + } + if (pInfo) { + pInfo->pTimer->Run((FWL_HTIMER)pInfo); + } } -- cgit v1.2.3