OLD | NEW |
---|---|
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" | 7 #include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h" |
8 | 8 |
9 #include "core/fpdfapi/parser/cpdf_array.h" | 9 #include "core/fpdfapi/parser/cpdf_array.h" |
10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" | 10 #include "core/fpdfapi/parser/cpdf_stream_acc.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 if (hWidget->CanCut()) | 251 if (hWidget->CanCut()) |
252 menuFlag |= FXFA_MENU_CUT; | 252 menuFlag |= FXFA_MENU_CUT; |
253 if (hWidget->CanSelectAll()) | 253 if (hWidget->CanSelectAll()) |
254 menuFlag |= FXFA_MENU_SELECTALL; | 254 menuFlag |= FXFA_MENU_SELECTALL; |
255 | 255 |
256 return pEnv->PopupMenu(pPage, hWidget, menuFlag, ptPopup); | 256 return pEnv->PopupMenu(pPage, hWidget, menuFlag, ptPopup); |
257 } | 257 } |
258 | 258 |
259 void CPDFXFA_DocEnvironment::PageViewEvent(CXFA_FFPageView* pPageView, | 259 void CPDFXFA_DocEnvironment::PageViewEvent(CXFA_FFPageView* pPageView, |
260 uint32_t dwFlags) { | 260 uint32_t dwFlags) { |
261 CPDFSDK_Environment* pEnv = m_pDocument->GetSDKDoc()->GetEnv(); | 261 CPDFSDK_Document* pSDKDoc = m_pDocument->GetSDKDoc(); |
dsinclair
2016/10/05 15:17:59
This is needed because PageViewEvent is fired when
Tom Sepez
2016/10/05 17:13:14
Acknowledged.
| |
262 if (!pSDKDoc) | |
263 return; | |
264 | |
265 CPDFSDK_Environment* pEnv = pSDKDoc->GetEnv(); | |
262 if (!pEnv) | 266 if (!pEnv) |
263 return; | 267 return; |
264 | 268 |
265 if (m_pDocument->GetLoadStatus() == FXFA_LOADSTATUS_LOADING || | 269 if (m_pDocument->GetLoadStatus() == FXFA_LOADSTATUS_LOADING || |
266 m_pDocument->GetLoadStatus() == FXFA_LOADSTATUS_CLOSING || | 270 m_pDocument->GetLoadStatus() == FXFA_LOADSTATUS_CLOSING || |
267 XFA_PAGEVIEWEVENT_StopLayout != dwFlags) | 271 XFA_PAGEVIEWEVENT_StopLayout != dwFlags) |
268 return; | 272 return; |
269 | 273 |
270 int nNewCount = m_pDocument->GetPageCount(); | 274 int nNewCount = m_pDocument->GetPageCount(); |
271 if (nNewCount == m_pDocument->GetOriginalPageCount()) | 275 if (nNewCount == m_pDocument->GetOriginalPageCount()) |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1011 if (!m_pJSContext) { | 1015 if (!m_pJSContext) { |
1012 m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->SetReaderDocument( | 1016 m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->SetReaderDocument( |
1013 m_pDocument->GetSDKDoc()); | 1017 m_pDocument->GetSDKDoc()); |
1014 m_pJSContext = | 1018 m_pJSContext = |
1015 m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->NewContext(); | 1019 m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->NewContext(); |
1016 } | 1020 } |
1017 | 1021 |
1018 return m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->GetValueByName( | 1022 return m_pDocument->GetSDKDoc()->GetEnv()->GetJSRuntime()->GetValueByName( |
1019 szPropName, pValue); | 1023 szPropName, pValue); |
1020 } | 1024 } |
OLD | NEW |