OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
11 // #include "../../include/javascript/JS_MsgBox.h" | 11 // #include "../../include/javascript/JS_MsgBox.h" |
12 // #include "../../include/javascript/JS_ResMgr.h" | 12 // #include "../../include/javascript/JS_ResMgr.h" |
13 #include "../../include/javascript/JS_Context.h" | 13 #include "../../include/javascript/JS_Context.h" |
14 | 14 |
| 15 JS_TIMER_MAPARRAY& GetTimeMap() |
| 16 { |
| 17 // Leak the timer array at shutdown. |
| 18 static auto* timeMap = new JS_TIMER_MAPARRAY; |
| 19 return *timeMap; |
| 20 } |
| 21 |
15 int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWS
TR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon) | 22 int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWS
TR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon) |
16 { | 23 { |
17 int nRet = 0; | 24 int nRet = 0; |
18 | 25 |
19 if (pApp) | 26 if (pApp) |
20 { | 27 { |
21 CPDFSDK_Document* pDoc = pApp->GetCurrentDoc(); | 28 CPDFSDK_Document* pDoc = pApp->GetCurrentDoc(); |
22 if(pDoc) | 29 if(pDoc) |
23 pDoc->KillFocusAnnot(); | 30 pDoc->KillFocusAnnot(); |
24 nRet = pApp->JS_appAlert(swMsg, swTitle, nType, nIcon); | 31 nRet = pApp->JS_appAlert(swMsg, swTitle, nType, nIcon); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 143 |
137 if (pContext->IsMsgBoxEnabled()) | 144 if (pContext->IsMsgBoxEnabled()) |
138 { | 145 { |
139 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); | 146 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); |
140 if(pApp) | 147 if(pApp) |
141 pApp->JS_appAlert(swMsg, NULL, 0, 3); | 148 pApp->JS_appAlert(swMsg, NULL, 0, 3); |
142 } | 149 } |
143 } | 150 } |
144 | 151 |
145 | 152 |
OLD | NEW |