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/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
8 #include "../../include/fxcrt/fx_xml.h" | 8 #include "../../include/fxcrt/fx_xml.h" |
9 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); | 9 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); |
10 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Docu
ment* pDocument); | 10 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Docu
ment* pDocument); |
(...skipping 16 matching lines...) Expand all Loading... |
27 FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFi
eldName); | 27 FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFi
eldName); |
28 FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, i
nt nLevel = 0); | 28 FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, i
nt nLevel = 0); |
29 void EncodeFieldName(const CFX_WideString& csName, CFX_ByteSt
ring& csT); | 29 void EncodeFieldName(const CFX_WideString& csName, CFX_ByteSt
ring& csT); |
30 void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int n
Level = 0); | 30 void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int n
Level = 0); |
31 const int nMaxRecursion = 32; | 31 const int nMaxRecursion = 32; |
32 class _CFieldNameExtractor | 32 class _CFieldNameExtractor |
33 { | 33 { |
34 public: | 34 public: |
35 _CFieldNameExtractor(const CFX_WideString& full_name) | 35 _CFieldNameExtractor(const CFX_WideString& full_name) |
36 { | 36 { |
37 m_pStart = full_name; | 37 m_pStart = full_name.c_str(); |
38 m_pEnd = m_pStart + full_name.GetLength(); | 38 m_pEnd = m_pStart + full_name.GetLength(); |
39 m_pCur = m_pStart; | 39 m_pCur = m_pStart; |
40 } | 40 } |
41 void GetNext(FX_LPCWSTR &pSubName, FX_STRSIZE& size) | 41 void GetNext(FX_LPCWSTR &pSubName, FX_STRSIZE& size) |
42 { | 42 { |
43 pSubName = m_pCur; | 43 pSubName = m_pCur; |
44 while (m_pCur < m_pEnd && m_pCur[0] != L'.') { | 44 while (m_pCur < m_pEnd && m_pCur[0] != L'.') { |
45 m_pCur++; | 45 m_pCur++; |
46 } | 46 } |
47 size = (FX_STRSIZE)(m_pCur - pSubName); | 47 size = (FX_STRSIZE)(m_pCur - pSubName); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 if (i == name2.GetLength()) { | 729 if (i == name2.GetLength()) { |
730 return 3; | 730 return 3; |
731 } | 731 } |
732 return 0; | 732 return 0; |
733 } else { | 733 } else { |
734 return name1 == name2 ? 1 : 0; | 734 return name1 == name2 ? 1 : 0; |
735 } | 735 } |
736 } | 736 } |
737 int CPDF_InterForm::CompareFieldName(const CFX_WideString& name1, const CFX_Wide
String& name2) | 737 int CPDF_InterForm::CompareFieldName(const CFX_WideString& name1, const CFX_Wide
String& name2) |
738 { | 738 { |
739 FX_LPCWSTR ptr1 = name1, ptr2 = name2; | 739 FX_LPCWSTR ptr1 = name1.c_str(); |
| 740 FX_LPCWSTR ptr2 = name2.c_str(); |
740 if (name1.GetLength() != name2.GetLength()) { | 741 if (name1.GetLength() != name2.GetLength()) { |
741 int i = 0; | 742 int i = 0; |
742 while (ptr1[i] == ptr2[i]) { | 743 while (ptr1[i] == ptr2[i]) { |
743 i ++; | 744 i ++; |
744 } | 745 } |
745 if (i == name1.GetLength()) { | 746 if (i == name1.GetLength()) { |
746 return 2; | 747 return 2; |
747 } | 748 } |
748 if (i == name2.GetLength()) { | 749 if (i == name2.GetLength()) { |
749 return 3; | 750 return 3; |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 continue; | 1656 continue; |
1656 } | 1657 } |
1657 CPDF_FormControl* pControl = NULL; | 1658 CPDF_FormControl* pControl = NULL; |
1658 if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) { | 1659 if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) { |
1659 return iNewPage; | 1660 return iNewPage; |
1660 } | 1661 } |
1661 } | 1662 } |
1662 } while (TRUE); | 1663 } while (TRUE); |
1663 return -1; | 1664 return -1; |
1664 } | 1665 } |
OLD | NEW |