summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_actionhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fsdk_actionhandler.cpp')
-rw-r--r--fpdfsdk/src/fsdk_actionhandler.cpp85
1 files changed, 12 insertions, 73 deletions
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index 6cb37b9c80..feb9a85137 100644
--- a/fpdfsdk/src/fsdk_actionhandler.cpp
+++ b/fpdfsdk/src/fsdk_actionhandler.cpp
@@ -149,18 +149,14 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action,
if (pEnv->IsJSInitiated()) {
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
- IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); //????
- ASSERT(pRuntime != NULL);
-
+ IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
pRuntime->SetReaderDocument(pDocument);
IJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
pContext->OnLink_MouseUp(pDocument);
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ FX_BOOL bRet = pContext->RunScript(swJS, &csInfo);
if (!bRet) {
// FIXME: return error.
}
@@ -293,65 +289,13 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
pRuntime->SetReaderDocument(pDocument);
IJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- // switch (type)
- // {
- // case CPDF_AAction::CursorEnter:
- // pContext->OnScreen_MouseEnter(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::CursorExit:
- // pContext->OnScreen_MouseExit(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::ButtonDown:
- // pContext->OnScreen_MouseDown(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::ButtonUp:
- // pContext->OnScreen_MouseUp(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::GetFocus:
- // pContext->OnScreen_Focus(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::LoseFocus:
- // pContext->OnScreen_Blur(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageOpen:
- // pContext->OnScreen_Open(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageClose:
- // pContext->OnScreen_Close(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageVisible:
- // pContext->OnScreen_InView(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageInvisible:
- // pContext->OnScreen_OutView(IsCTRLpressed(),
- // IsSHIFTpressed(), pScreen);
- // break;
- // default:
- // ASSERT(FALSE);
- // break;
- // }
-
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ FX_BOOL bRet = pContext->RunScript(swJS, &csInfo);
if (!bRet) {
- // CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(),
- // csInfo);
+ // FIXME: return error.
}
pRuntime->ReleaseContext(pContext);
@@ -389,20 +333,15 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action,
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
IJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
pRuntime->SetReaderDocument(pDocument);
IJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
pContext->OnBookmark_MouseUp(pBookmark);
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ FX_BOOL bRet = pContext->RunScript(swJS, &csInfo);
if (!bRet) {
- // CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(),
- // csInfo);
+ // FIXME: return error.
}
pRuntime->ReleaseContext(pContext);
@@ -602,9 +541,9 @@ void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument,
}
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ FX_BOOL bRet = pContext->RunScript(script, &csInfo);
if (!bRet) {
- // CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ // FIXME: return error.
}
pRuntime->ReleaseContext(pContext);
@@ -627,9 +566,9 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(
pContext->OnDoc_Open(pDocument, sScriptName);
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ FX_BOOL bRet = pContext->RunScript(script, &csInfo);
if (!bRet) {
- // CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ // FIXME: return error.
}
pRuntime->ReleaseContext(pContext);
@@ -683,9 +622,9 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(
}
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ FX_BOOL bRet = pContext->RunScript(script, &csInfo);
if (!bRet) {
- // CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ // FIXME: return error.
}
pRuntime->ReleaseContext(pContext);