| 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/include/cpdfsdk_interform.h" | 7 #include "fpdfsdk/include/cpdfsdk_interform.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField) { | 338 void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField) { |
| 339 for (int i = 0, sz = pFormField->CountControls(); i < sz; i++) { | 339 for (int i = 0, sz = pFormField->CountControls(); i < sz; i++) { |
| 340 CPDF_FormControl* pFormCtrl = pFormField->GetControl(i); | 340 CPDF_FormControl* pFormCtrl = pFormField->GetControl(i); |
| 341 ASSERT(pFormCtrl); | 341 ASSERT(pFormCtrl); |
| 342 | 342 |
| 343 if (CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl, false)) { | 343 if (CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl, false)) { |
| 344 CPDFSDK_Environment* pEnv = m_pDocument->GetEnv(); | 344 CPDFSDK_Environment* pEnv = m_pDocument->GetEnv(); |
| 345 CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller(); | |
| 346 UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); | 345 UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); |
| 347 CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false); | 346 CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false); |
| 348 FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget); | 347 FX_RECT rcBBox = |
| 348 pEnv->GetInteractiveFormFiller()->GetViewBBox(pPageView, pWidget); |
| 349 | 349 |
| 350 pEnv->Invalidate(pPage, rcBBox.left, rcBBox.top, rcBBox.right, | 350 pEnv->Invalidate(pPage, rcBBox.left, rcBBox.top, rcBBox.right, |
| 351 rcBBox.bottom); | 351 rcBBox.bottom); |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 | 355 |
| 356 FX_BOOL CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, | 356 FX_BOOL CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, |
| 357 const CFX_WideString& csValue) { | 357 const CFX_WideString& csValue) { |
| 358 CPDF_AAction aAction = pFormField->GetAdditionalAction(); | 358 CPDF_AAction aAction = pFormField->GetAdditionalAction(); |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 } | 719 } |
| 720 } | 720 } |
| 721 | 721 |
| 722 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { | 722 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { |
| 723 if (nFieldType < 0 || nFieldType > kNumFieldTypes) | 723 if (nFieldType < 0 || nFieldType > kNumFieldTypes) |
| 724 return FXSYS_RGB(255, 255, 255); | 724 return FXSYS_RGB(255, 255, 255); |
| 725 if (nFieldType == 0) | 725 if (nFieldType == 0) |
| 726 return m_aHighlightColor[0]; | 726 return m_aHighlightColor[0]; |
| 727 return m_aHighlightColor[nFieldType - 1]; | 727 return m_aHighlightColor[nFieldType - 1]; |
| 728 } | 728 } |
| OLD | NEW |