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(); | 345 CFFL_InteractiveFormFiller* pInteractiveFormFiller = |
Tom Sepez
2016/09/21 18:15:30
nit: if you wanted to save space, you could call t
dsinclair
2016/09/21 18:34:01
Done.
| |
346 pEnv->GetInteractiveFormFiller(); | |
346 UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); | 347 UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); |
347 CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false); | 348 CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage, false); |
348 FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget); | 349 FX_RECT rcBBox = pInteractiveFormFiller->GetViewBBox(pPageView, pWidget); |
349 | 350 |
350 pEnv->Invalidate(pPage, rcBBox.left, rcBBox.top, rcBBox.right, | 351 pEnv->Invalidate(pPage, rcBBox.left, rcBBox.top, rcBBox.right, |
351 rcBBox.bottom); | 352 rcBBox.bottom); |
352 } | 353 } |
353 } | 354 } |
354 } | 355 } |
355 | 356 |
356 FX_BOOL CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, | 357 FX_BOOL CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, |
357 const CFX_WideString& csValue) { | 358 const CFX_WideString& csValue) { |
358 CPDF_AAction aAction = pFormField->GetAdditionalAction(); | 359 CPDF_AAction aAction = pFormField->GetAdditionalAction(); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
719 } | 720 } |
720 } | 721 } |
721 | 722 |
722 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { | 723 FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) { |
723 if (nFieldType < 0 || nFieldType > kNumFieldTypes) | 724 if (nFieldType < 0 || nFieldType > kNumFieldTypes) |
724 return FXSYS_RGB(255, 255, 255); | 725 return FXSYS_RGB(255, 255, 255); |
725 if (nFieldType == 0) | 726 if (nFieldType == 0) |
726 return m_aHighlightColor[0]; | 727 return m_aHighlightColor[0]; |
727 return m_aHighlightColor[nFieldType - 1]; | 728 return m_aHighlightColor[nFieldType - 1]; |
728 } | 729 } |
OLD | NEW |