summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/include/fsdk_mgr.h4
-rw-r--r--fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp8
2 files changed, 10 insertions, 2 deletions
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 72497e2d5f..2df44c7ca1 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -404,6 +404,10 @@ class CPDFDoc_Environment final {
}
return L"";
}
+ void FFI_PageEvent(int iPageIndex, int iEventType) const {
+ // Todo: call a call-back function when it's implemented
+ // in applicaiton's side.
+ }
#endif // PDF_ENABLE_XFA
int JS_appAlert(const FX_WCHAR* Msg,
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
index e1f14aa9d4..b8549fce74 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
@@ -477,17 +477,21 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
return;
}
CPDFXFA_Page* pPage = nullptr;
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
if (dwFlags == XFA_PAGEVIEWEVENT_PostAdded) {
- pPage = GetPage(pPageView->GetPageViewIndex());
+ int nPageIndex = pPageView->GetPageViewIndex();
+ pPage = GetPage(nPageIndex);
if (pPage)
pPage->SetXFAPageView(pPageView);
+ pEnv->FFI_PageEvent(nPageIndex, dwFlags);
return;
}
pPage = GetPage(pPageView);
if (!pPage)
return;
- pPage->SetXFAPageView(nullptr);
+ pEnv->FFI_PageEvent(pPage->GetPageIndex(), dwFlags);
m_pSDKDoc->GetPageView(pPage)->ClearFXAnnots();
+ pPage->Release();
}
void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget,