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

Unified Diff: fpdfsdk/fpdfformfill.cpp

Issue 2230983003: Use CPDFSDK_Document::FromFPDFFormHandle in ::FORM_DoPageAAction (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use CPDFSDK_Document::FromFPDFFormHandle in ::FORM_DoPageAAction Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfformfill.cpp
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 253091789ce096c3eee389b591e665eedcbb0aa7..8d5b4b789ddbce9983fe68ad1b6ef6847ebb6c36 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -704,26 +704,32 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
int aaType) {
if (!hHandle)
return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
+
+ CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle);
+ if (!pSDKDoc)
+ return;
+
UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return;
- if (pSDKDoc->GetPageView(pPage, false)) {
- CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
- CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
- CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
- CPDF_AAction aa(pPageDict->GetDictBy("AA"));
- if (FPDFPAGE_AACTION_OPEN == aaType) {
- if (aa.ActionExist(CPDF_AAction::OpenPage)) {
- CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
- pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
- }
- } else {
- if (aa.ActionExist(CPDF_AAction::ClosePage)) {
- CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
- pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
- }
+
+ if (!pSDKDoc->GetPageView(pPage, false))
+ return;
+
+ CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
+ CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
+ CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
+ CPDF_AAction aa(pPageDict->GetDictBy("AA"));
+ if (FPDFPAGE_AACTION_OPEN == aaType) {
+ if (aa.ActionExist(CPDF_AAction::OpenPage)) {
+ CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
+ pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
+ }
+ } else {
+ if (aa.ActionExist(CPDF_AAction::ClosePage)) {
+ CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
+ pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698