| 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/fpdfxfa/fpdfxfa_doc.h" | 8 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 9 #include "../include/fpdfxfa/fpdfxfa_util.h" | 9 #include "../include/fpdfxfa/fpdfxfa_util.h" |
| 10 #include "../include/fsdk_mgr.h" | 10 #include "../include/fsdk_mgr.h" |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 ASSERT(pDoc != NULL); | 727 ASSERT(pDoc != NULL); |
| 728 | 728 |
| 729 CFX_ByteString sSubType = pAnnot->GetSubType(); | 729 CFX_ByteString sSubType = pAnnot->GetSubType(); |
| 730 | 730 |
| 731 if (sSubType == BFFT_SIGNATURE) | 731 if (sSubType == BFFT_SIGNATURE) |
| 732 { | 732 { |
| 733 } | 733 } |
| 734 else | 734 else |
| 735 { | 735 { |
| 736 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 736 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
| 737 » » | 737 » » if (!pWidget->IsAppearanceValid()) |
| 738 » if (!pWidget->IsAppearanceValid()) | |
| 739 pWidget->ResetAppearance(NULL, FALSE); | 738 pWidget->ResetAppearance(NULL, FALSE); |
| 740 » » | 739 |
| 741 int nFieldType = pWidget->GetFieldType(); | 740 int nFieldType = pWidget->GetFieldType(); |
| 742 | |
| 743 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE
_COMBOBOX) | 741 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE
_COMBOBOX) |
| 744 { | 742 { |
| 745 FX_BOOL bFormated = FALSE; | 743 FX_BOOL bFormated = FALSE; |
| 746 CFX_WideString sValue = pWidget->OnFormat(0, bFormated); | 744 CFX_WideString sValue = pWidget->OnFormat(0, bFormated); |
| 747 | |
| 748 if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) | 745 if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) |
| 749 { | 746 { |
| 750 » » » » pWidget->ResetAppearance(sValue, FALSE); | 747 » » » » pWidget->ResetAppearance(sValue.c_str(), FALSE); |
| 751 } | 748 } |
| 752 } | 749 } |
| 753 | 750 |
| 754 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) | 751 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) |
| 755 { | 752 { |
| 756 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue(
).IsEmpty()) | 753 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue(
).IsEmpty()) |
| 757 pWidget->ResetAppearance(FALSE); | 754 pWidget->ResetAppearance(FALSE); |
| 758 } | 755 } |
| 759 | 756 |
| 760 | 757 |
| 761 if (m_pFormFiller) | 758 if (m_pFormFiller) |
| 762 m_pFormFiller->OnLoad(pAnnot); | 759 m_pFormFiller->OnLoad(pAnnot); |
| 763 | |
| 764 } | 760 } |
| 765 } | 761 } |
| 766 | 762 |
| 767 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag
) | 763 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag
) |
| 768 { | 764 { |
| 769 ASSERT(pAnnot != NULL); | 765 ASSERT(pAnnot != NULL); |
| 770 CFX_ByteString sSubType = pAnnot->GetSubType(); | 766 CFX_ByteString sSubType = pAnnot->GetSubType(); |
| 771 | 767 |
| 772 if (sSubType == BFFT_SIGNATURE) | 768 if (sSubType == BFFT_SIGNATURE) |
| 773 { | 769 { |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 m_pIteratorAnnotList.RemoveAt(i); | 1404 m_pIteratorAnnotList.RemoveAt(i); |
| 1409 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); | 1405 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); |
| 1410 break; | 1406 break; |
| 1411 } | 1407 } |
| 1412 } | 1408 } |
| 1413 } | 1409 } |
| 1414 | 1410 |
| 1415 return TRUE; | 1411 return TRUE; |
| 1416 } | 1412 } |
| 1417 | 1413 |
| OLD | NEW |