| 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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
| 8 #include "../include/fsdk_mgr.h" | 8 #include "../include/fsdk_mgr.h" |
| 9 #include "../include/formfiller/FFL_FormFiller.h" | 9 #include "../include/formfiller/FFL_FormFiller.h" |
| 10 #include "../include/fsdk_annothandler.h" | 10 #include "../include/fsdk_annothandler.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 ASSERT(pAnnot != NULL); | 661 ASSERT(pAnnot != NULL); |
| 662 | 662 |
| 663 CFX_ByteString sSubType = pAnnot->GetSubType(); | 663 CFX_ByteString sSubType = pAnnot->GetSubType(); |
| 664 | 664 |
| 665 if (sSubType == BFFT_SIGNATURE) | 665 if (sSubType == BFFT_SIGNATURE) |
| 666 { | 666 { |
| 667 } | 667 } |
| 668 else | 668 else |
| 669 { | 669 { |
| 670 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 670 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
| 671 » » | 671 » » if (!pWidget->IsAppearanceValid()) |
| 672 » if (!pWidget->IsAppearanceValid()) | |
| 673 pWidget->ResetAppearance(NULL, FALSE); | 672 pWidget->ResetAppearance(NULL, FALSE); |
| 674 » » | 673 |
| 675 int nFieldType = pWidget->GetFieldType(); | 674 int nFieldType = pWidget->GetFieldType(); |
| 676 | |
| 677 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE
_COMBOBOX) | 675 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE
_COMBOBOX) |
| 678 { | 676 { |
| 679 FX_BOOL bFormated = FALSE; | 677 FX_BOOL bFormated = FALSE; |
| 680 CFX_WideString sValue = pWidget->OnFormat(0, bFormated); | 678 CFX_WideString sValue = pWidget->OnFormat(0, bFormated); |
| 681 | |
| 682 if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) | 679 if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) |
| 683 { | 680 { |
| 684 » » » » pWidget->ResetAppearance(sValue, FALSE); | 681 » » » » pWidget->ResetAppearance(sValue.c_str(), FALSE); |
| 685 } | 682 } |
| 686 } | 683 } |
| 687 | |
| 688 | 684 |
| 689 if (m_pFormFiller) | 685 if (m_pFormFiller) |
| 690 m_pFormFiller->OnLoad(pAnnot); | 686 m_pFormFiller->OnLoad(pAnnot); |
| 691 | |
| 692 } | 687 } |
| 693 } | 688 } |
| 694 | 689 |
| 695 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag
) | 690 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag
) |
| 696 { | 691 { |
| 697 ASSERT(pAnnot != NULL); | 692 ASSERT(pAnnot != NULL); |
| 698 CFX_ByteString sSubType = pAnnot->GetSubType(); | 693 CFX_ByteString sSubType = pAnnot->GetSubType(); |
| 699 | 694 |
| 700 if (sSubType == BFFT_SIGNATURE) | 695 if (sSubType == BFFT_SIGNATURE) |
| 701 { | 696 { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 m_pIteratorAnnotList.RemoveAt(i); | 931 m_pIteratorAnnotList.RemoveAt(i); |
| 937 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); | 932 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); |
| 938 break; | 933 break; |
| 939 } | 934 } |
| 940 } | 935 } |
| 941 } | 936 } |
| 942 | 937 |
| 943 return TRUE; | 938 return TRUE; |
| 944 } | 939 } |
| 945 | 940 |
| OLD | NEW |