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

Unified Diff: fpdfsdk/fsdk_actionhandler.cpp

Issue 2399943002: Remove CPDFSDK_Document from IJS_Context (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/javascript/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fsdk_actionhandler.cpp
diff --git a/fpdfsdk/fsdk_actionhandler.cpp b/fpdfsdk/fsdk_actionhandler.cpp
index 08a03edafe0073e612aa59b1d3fb89817f5d9bbe..f6ba4c9d9c9db89ac72826223bbe00760b25a060 100644
--- a/fpdfsdk/fsdk_actionhandler.cpp
+++ b/fpdfsdk/fsdk_actionhandler.cpp
@@ -148,17 +148,17 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(
visited->insert(pDict);
- CPDFSDK_FormFillEnvironment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
+ CPDFSDK_FormFillEnvironment* pFormFillEnv = pDocument->GetEnv();
+ ASSERT(pFormFillEnv);
if (action.GetType() == CPDF_Action::JavaScript) {
- if (pEnv->IsJSInitiated()) {
+ if (pFormFillEnv->IsJSInitiated()) {
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
- IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
+ IJS_Runtime* pRuntime = pFormFillEnv->GetJSRuntime();
pRuntime->SetReaderDocument(pDocument);
IJS_Context* pContext = pRuntime->NewContext();
- pContext->OnLink_MouseUp(pDocument);
+ pContext->OnLink_MouseUp(pFormFillEnv);
CFX_WideString csInfo;
FX_BOOL bRet = pContext->RunScript(swJS, &csInfo);
@@ -534,7 +534,7 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
pRuntime->SetReaderDocument(pDocument);
IJS_Context* pContext = pRuntime->NewContext();
- pContext->OnDoc_Open(pDocument, sScriptName);
+ pContext->OnDoc_Open(pDocument->GetEnv(), sScriptName);
CFX_WideString csInfo;
FX_BOOL bRet = pContext->RunScript(script, &csInfo);
@@ -555,31 +555,31 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(
IJS_Context* pContext = pRuntime->NewContext();
switch (type) {
case CPDF_AAction::OpenPage:
- pContext->OnPage_Open(pDocument);
+ pContext->OnPage_Open(pDocument->GetEnv());
break;
case CPDF_AAction::ClosePage:
- pContext->OnPage_Close(pDocument);
+ pContext->OnPage_Close(pDocument->GetEnv());
break;
case CPDF_AAction::CloseDocument:
- pContext->OnDoc_WillClose(pDocument);
+ pContext->OnDoc_WillClose(pDocument->GetEnv());
break;
case CPDF_AAction::SaveDocument:
- pContext->OnDoc_WillSave(pDocument);
+ pContext->OnDoc_WillSave(pDocument->GetEnv());
break;
case CPDF_AAction::DocumentSaved:
- pContext->OnDoc_DidSave(pDocument);
+ pContext->OnDoc_DidSave(pDocument->GetEnv());
break;
case CPDF_AAction::PrintDocument:
- pContext->OnDoc_WillPrint(pDocument);
+ pContext->OnDoc_WillPrint(pDocument->GetEnv());
break;
case CPDF_AAction::DocumentPrinted:
- pContext->OnDoc_DidPrint(pDocument);
+ pContext->OnDoc_DidPrint(pDocument->GetEnv());
break;
case CPDF_AAction::PageVisible:
- pContext->OnPage_InView(pDocument);
+ pContext->OnPage_InView(pDocument->GetEnv());
break;
case CPDF_AAction::PageInvisible:
- pContext->OnPage_OutView(pDocument);
+ pContext->OnPage_OutView(pDocument->GetEnv());
break;
default:
ASSERT(FALSE);
« no previous file with comments | « no previous file | fpdfsdk/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698