Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: core/src/fpdfdoc/doc_form.cpp

Issue 1108903002: Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fpdfdoc/doc_basic.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_basic.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698