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

Side by Side Diff: fpdfsdk/javascript/Document.cpp

Issue 2400443005: Convert Field to use CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 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 | « fpdfsdk/cpdfsdk_formfillenvironment.h ('k') | fpdfsdk/javascript/Field.h » ('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 "fpdfsdk/javascript/Document.h" 7 #include "fpdfsdk/javascript/Document.h"
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) { 880 if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) {
881 sError = JSGetStringFromID(IDS_STRING_JSNOPERMISSION); 881 sError = JSGetStringFromID(IDS_STRING_JSNOPERMISSION);
882 return FALSE; 882 return FALSE;
883 } 883 }
884 vp >> m_bDelay; 884 vp >> m_bDelay;
885 if (m_bDelay) { 885 if (m_bDelay) {
886 m_DelayData.clear(); 886 m_DelayData.clear();
887 } else { 887 } else {
888 std::list<std::unique_ptr<CJS_DelayData>> DelayDataToProcess; 888 std::list<std::unique_ptr<CJS_DelayData>> DelayDataToProcess;
889 DelayDataToProcess.swap(m_DelayData); 889 DelayDataToProcess.swap(m_DelayData);
890 for (const auto& pData : DelayDataToProcess) 890 for (const auto& pData : DelayDataToProcess) {
891 Field::DoDelay(m_pDocument.Get(), pData.get()); 891 if (m_pDocument.Get())
892 Field::DoDelay(m_pDocument->GetEnv(), pData.get());
893 }
892 } 894 }
893 } 895 }
894 return TRUE; 896 return TRUE;
895 } 897 }
896 898
897 FX_BOOL Document::keywords(IJS_Context* cc, 899 FX_BOOL Document::keywords(IJS_Context* cc,
898 CJS_PropValue& vp, 900 CJS_PropValue& vp,
899 CFX_WideString& sError) { 901 CFX_WideString& sError) {
900 return getPropertyInternal(cc, vp, "Keywords", sError); 902 return getPropertyInternal(cc, vp, "Keywords", sError);
901 } 903 }
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 auto iter = m_DelayData.begin(); 1716 auto iter = m_DelayData.begin();
1715 while (iter != m_DelayData.end()) { 1717 while (iter != m_DelayData.end()) {
1716 auto old = iter++; 1718 auto old = iter++;
1717 if ((*old)->sFieldName == sFieldName && 1719 if ((*old)->sFieldName == sFieldName &&
1718 (*old)->nControlIndex == nControlIndex) { 1720 (*old)->nControlIndex == nControlIndex) {
1719 DelayDataForFieldAndControlIndex.push_back(std::move(*old)); 1721 DelayDataForFieldAndControlIndex.push_back(std::move(*old));
1720 m_DelayData.erase(old); 1722 m_DelayData.erase(old);
1721 } 1723 }
1722 } 1724 }
1723 1725
1724 for (const auto& pData : DelayDataForFieldAndControlIndex) 1726 for (const auto& pData : DelayDataForFieldAndControlIndex) {
1725 Field::DoDelay(m_pDocument.Get(), pData.get()); 1727 if (m_pDocument.Get())
1728 Field::DoDelay(m_pDocument->GetEnv(), pData.get());
1729 }
1726 } 1730 }
1727 1731
1728 CJS_Document* Document::GetCJSDoc() const { 1732 CJS_Document* Document::GetCJSDoc() const {
1729 return static_cast<CJS_Document*>(m_pJSObject); 1733 return static_cast<CJS_Document*>(m_pJSObject);
1730 } 1734 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_formfillenvironment.h ('k') | fpdfsdk/javascript/Field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698