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

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

Issue 2354413002: Rename App to Env where needed. (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/include/cpdfsdk_xfawidgethandler.h ('k') | fpdfsdk/javascript/PublicMethods.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 "fpdfsdk/javascript/Document.h" 7 #include "fpdfsdk/javascript/Document.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 CFX_WideString cSubject = 400 CFX_WideString cSubject =
401 iLength > 4 ? params[4].ToCFXWideString(pRuntime) : L""; 401 iLength > 4 ? params[4].ToCFXWideString(pRuntime) : L"";
402 CFX_WideString cMsg = iLength > 5 ? params[5].ToCFXWideString(pRuntime) : L""; 402 CFX_WideString cMsg = iLength > 5 ? params[5].ToCFXWideString(pRuntime) : L"";
403 403
404 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm(); 404 CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
405 CFX_ByteTextBuf textBuf; 405 CFX_ByteTextBuf textBuf;
406 if (!pInterForm->ExportFormToFDFTextBuf(textBuf)) 406 if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
407 return FALSE; 407 return FALSE;
408 408
409 pRuntime->BeginBlock(); 409 pRuntime->BeginBlock();
410 CPDFSDK_Environment* pEnv = pContext->GetReaderApp(); 410 CPDFSDK_Environment* pEnv = pContext->GetReaderEnv();
411 pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, 411 pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI,
412 cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), 412 cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(),
413 cMsg.c_str()); 413 cMsg.c_str());
414 pRuntime->EndBlock(); 414 pRuntime->EndBlock();
415 return TRUE; 415 return TRUE;
416 } 416 }
417 417
418 FX_BOOL Document::print(IJS_Context* cc, 418 FX_BOOL Document::print(IJS_Context* cc,
419 const std::vector<CJS_Value>& params, 419 const std::vector<CJS_Value>& params,
420 CJS_Value& vRet, 420 CJS_Value& vRet,
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 cBcc = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime); 748 cBcc = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime);
749 749
750 pValue = pRuntime->GetObjectProperty(pObj, L"cSubject"); 750 pValue = pRuntime->GetObjectProperty(pObj, L"cSubject");
751 cSubject = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime); 751 cSubject = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime);
752 752
753 pValue = pRuntime->GetObjectProperty(pObj, L"cMsg"); 753 pValue = pRuntime->GetObjectProperty(pObj, L"cMsg");
754 cMsg = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime); 754 cMsg = CJS_Value(pRuntime, pValue).ToCFXWideString(pRuntime);
755 } 755 }
756 756
757 pRuntime->BeginBlock(); 757 pRuntime->BeginBlock();
758 CPDFSDK_Environment* pEnv = pRuntime->GetReaderApp(); 758 CPDFSDK_Environment* pEnv = pRuntime->GetReaderEnv();
759 pEnv->JS_docmailForm(nullptr, 0, bUI, cTo.c_str(), cSubject.c_str(), 759 pEnv->JS_docmailForm(nullptr, 0, bUI, cTo.c_str(), cSubject.c_str(),
760 cCc.c_str(), cBcc.c_str(), cMsg.c_str()); 760 cCc.c_str(), cBcc.c_str(), cMsg.c_str());
761 pRuntime->EndBlock(); 761 pRuntime->EndBlock();
762 762
763 return TRUE; 763 return TRUE;
764 } 764 }
765 765
766 FX_BOOL Document::author(IJS_Context* cc, 766 FX_BOOL Document::author(IJS_Context* cc,
767 CJS_PropValue& vp, 767 CJS_PropValue& vp,
768 CFX_WideString& sError) { 768 CFX_WideString& sError) {
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 } 1720 }
1721 } 1721 }
1722 1722
1723 for (const auto& pData : DelayDataForFieldAndControlIndex) 1723 for (const auto& pData : DelayDataForFieldAndControlIndex)
1724 Field::DoDelay(m_pDocument.Get(), pData.get()); 1724 Field::DoDelay(m_pDocument.Get(), pData.get());
1725 } 1725 }
1726 1726
1727 CJS_Document* Document::GetCJSDoc() const { 1727 CJS_Document* Document::GetCJSDoc() const {
1728 return static_cast<CJS_Document*>(m_pJSObject); 1728 return static_cast<CJS_Document*>(m_pJSObject);
1729 } 1729 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/cpdfsdk_xfawidgethandler.h ('k') | fpdfsdk/javascript/PublicMethods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698