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/formfiller/cffl_iformfiller.h" | 7 #include "fpdfsdk/formfiller/cffl_iformfiller.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 } | 702 } |
703 } | 703 } |
704 | 704 |
705 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, | 705 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, |
706 CPDFSDK_PageView* pPageView, | 706 CPDFSDK_PageView* pPageView, |
707 FX_BOOL& bExit, | 707 FX_BOOL& bExit, |
708 uint32_t nFlag) { | 708 uint32_t nFlag) { |
709 if (!m_bNotifying) { | 709 if (!m_bNotifying) { |
710 ASSERT(pWidget); | 710 ASSERT(pWidget); |
711 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); | 711 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); |
712 CPDFSDK_InterForm* pInterForm = | 712 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); |
713 (CPDFSDK_InterForm*)pDocument->GetInterForm(); | |
714 pInterForm->OnCalculate(pWidget->GetFormField()); | 713 pInterForm->OnCalculate(pWidget->GetFormField()); |
715 | |
716 m_bNotifying = FALSE; | 714 m_bNotifying = FALSE; |
717 } | 715 } |
718 } | 716 } |
719 | 717 |
720 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, | 718 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, |
721 CPDFSDK_PageView* pPageView, | 719 CPDFSDK_PageView* pPageView, |
722 FX_BOOL& bExit, | 720 FX_BOOL& bExit, |
723 uint32_t nFlag) { | 721 uint32_t nFlag) { |
724 if (!m_bNotifying) { | 722 if (!m_bNotifying) { |
725 ASSERT(pWidget); | 723 ASSERT(pWidget); |
726 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); | 724 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); |
727 CPDFSDK_InterForm* pInterForm = | 725 CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm(); |
728 (CPDFSDK_InterForm*)pDocument->GetInterForm(); | |
729 | 726 |
730 FX_BOOL bFormated = FALSE; | 727 FX_BOOL bFormated = FALSE; |
731 CFX_WideString sValue = | 728 CFX_WideString sValue = |
732 pInterForm->OnFormat(pWidget->GetFormField(), bFormated); | 729 pInterForm->OnFormat(pWidget->GetFormField(), bFormated); |
733 | 730 |
734 if (bExit) | 731 if (bExit) |
735 return; | 732 return; |
736 | 733 |
737 if (bFormated) { | 734 if (bFormated) { |
738 pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), | 735 pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 bExit = TRUE; | 1005 bExit = TRUE; |
1009 m_bNotifying = FALSE; | 1006 m_bNotifying = FALSE; |
1010 return; | 1007 return; |
1011 } | 1008 } |
1012 } | 1009 } |
1013 | 1010 |
1014 m_bNotifying = FALSE; | 1011 m_bNotifying = FALSE; |
1015 } | 1012 } |
1016 } | 1013 } |
1017 } | 1014 } |
OLD | NEW |