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

Unified Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp

Issue 1640233004: XFA: Fix a crashier in SetFocus() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Remove FFI_PageEvent Created 4 years, 11 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 | « fpdfsdk/include/fsdk_mgr.h ('k') | public/fpdf_formfill.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
index d37038d2af6ef580edbcfacb16bf9671a50a7385..19a2f0fb7e8090f6d02075ec072cc16cb58d0853 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,
« no previous file with comments | « fpdfsdk/include/fsdk_mgr.h ('k') | public/fpdf_formfill.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698