summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-02-02 18:12:23 -0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-02-02 18:12:23 -0800
commitc30d5bf3efaef5c7254ae326466e6a35cff63365 (patch)
tree7dbbd7002bafe4343f121f503c39006f83e9f760 /fpdfsdk/src
parentef86dcd61c4b42d3787638e6ec5b96d4d7b4167b (diff)
downloadpdfium-c30d5bf3efaef5c7254ae326466e6a35cff63365.tar.xz
XFA: Fix a crashier in SetFocus()
BUG=pdfium:374 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1640233004 .
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r--fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp8
1 files changed, 6 insertions, 2 deletions
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,