Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2385)

Unified Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp

Issue 1641963002: XFA: Fix DOS newlines, final round. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp
index dc1cf9b516a56ef472ff451817e33a64fe7b53a7..5f8a9f01c592c9ef772e6a4042d45f088e69c628 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp
@@ -1,65 +1,65 @@
-// 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 "fpdfsdk/include/fsdk_define.h"
-#include "fpdfsdk/include/fsdk_mgr.h"
-#include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h"
-
-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 = new CFWL_TimerInfo;
- pInfo->uIDEvent = uIDEvent;
- pInfo->pTimer = pTimer;
- ms_timerArray.Add(pInfo);
-
- hTimer = (FWL_HTIMER)pInfo;
- return FWL_ERR_Succeeded;
- }
-
- 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;
-
- 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;
- }
-
- 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);
- }
-}
+// 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 "fpdfsdk/include/fsdk_define.h"
+#include "fpdfsdk/include/fsdk_mgr.h"
+#include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h"
+
+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 = new CFWL_TimerInfo;
+ pInfo->uIDEvent = uIDEvent;
+ pInfo->pTimer = pTimer;
+ ms_timerArray.Add(pInfo);
+
+ hTimer = (FWL_HTIMER)pInfo;
+ return FWL_ERR_Succeeded;
+ }
+
+ 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;
+
+ 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;
+ }
+
+ 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);
+ }
+}
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698