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 "fpdfsdk/javascript/Field.h" | 7 #include "fpdfsdk/javascript/Field.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 3229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3240 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); | 3240 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); |
3241 CPDFSDK_Widget* pWidget = nullptr; | 3241 CPDFSDK_Widget* pWidget = nullptr; |
3242 if (nCount == 1) { | 3242 if (nCount == 1) { |
3243 pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); | 3243 pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); |
3244 } else { | 3244 } else { |
3245 CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); | 3245 CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); |
3246 UnderlyingPageType* pPage = UnderlyingFromFPDFPage( | 3246 UnderlyingPageType* pPage = UnderlyingFromFPDFPage( |
3247 pEnv->FFI_GetCurrentPage(m_pDocument->GetUnderlyingDocument())); | 3247 pEnv->FFI_GetCurrentPage(m_pDocument->GetUnderlyingDocument())); |
3248 if (!pPage) | 3248 if (!pPage) |
3249 return FALSE; | 3249 return FALSE; |
3250 if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage)) { | 3250 if (CPDFSDK_PageView* pCurPageView = |
| 3251 m_pDocument->GetPageView(pPage, true)) { |
3251 for (int32_t i = 0; i < nCount; i++) { | 3252 for (int32_t i = 0; i < nCount; i++) { |
3252 if (CPDFSDK_Widget* pTempWidget = | 3253 if (CPDFSDK_Widget* pTempWidget = |
3253 pInterForm->GetWidget(pFormField->GetControl(i))) { | 3254 pInterForm->GetWidget(pFormField->GetControl(i))) { |
3254 if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage()) { | 3255 if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage()) { |
3255 pWidget = pTempWidget; | 3256 pWidget = pTempWidget; |
3256 break; | 3257 break; |
3257 } | 3258 } |
3258 } | 3259 } |
3259 } | 3260 } |
3260 } | 3261 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3530 } | 3531 } |
3531 } | 3532 } |
3532 | 3533 |
3533 void Field::AddField(CPDFSDK_Document* pDocument, | 3534 void Field::AddField(CPDFSDK_Document* pDocument, |
3534 int nPageIndex, | 3535 int nPageIndex, |
3535 int nFieldType, | 3536 int nFieldType, |
3536 const CFX_WideString& sName, | 3537 const CFX_WideString& sName, |
3537 const CFX_FloatRect& rcCoords) { | 3538 const CFX_FloatRect& rcCoords) { |
3538 // Not supported. | 3539 // Not supported. |
3539 } | 3540 } |
OLD | NEW |