summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfformfill.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-07-27 07:40:05 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-27 07:40:06 -0700
commit461eeafe191068ac8c32f2717907fc6a22a667d2 (patch)
tree25ec06f69550c6daeed66687d4d00fef1d4db4f4 /fpdfsdk/fpdfformfill.cpp
parentc279a3e1bd3da4e7f7504e438e6df8b7079027f9 (diff)
downloadpdfium-461eeafe191068ac8c32f2717907fc6a22a667d2.tar.xz
Reland of Remove pageview from map immediately
This reverts commit f2cee9894b9f7cf2e50060965ad1eedd90ab55b6. This CL removes the default parameter from the CPDFSDK_Document::GetPageView |ReNew| flag and updates the code as needed. In CFFL_FormFillter::KillFocusForAnnot we flip the flag to |FALSE| as we don't want to re-create the page view if it is already removed. If we don't do this then the page view will be re-created in the map, the page associated to the page view, but then the page can be deleted out from under the pageview as it isn't owned by the page view. BUG=chromium:630654 Review-Url: https://codereview.chromium.org/2179163004
Diffstat (limited to 'fpdfsdk/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/fpdfformfill.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 60e9e52915..35f53c48b3 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -41,7 +41,7 @@ CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle,
return nullptr;
CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle);
- return pSDKDoc ? pSDKDoc->GetPageView(pPage, TRUE) : nullptr;
+ return pSDKDoc ? pSDKDoc->GetPageView(pPage, true) : nullptr;
}
#ifdef PDF_ENABLE_XFA
@@ -131,7 +131,7 @@ void FFLCommon(FPDF_FORMHANDLE hHandle,
options.m_AddFlags = flags >> 8;
options.m_pOCContext = new CPDF_OCContext(pPDFDoc, CPDF_OCContext::View);
- if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage))
+ if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage, true))
pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip);
#endif // PDF_ENABLE_XFA
@@ -655,7 +655,7 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page,
if (!pPage)
return;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, false);
if (pPageView) {
pPageView->SetValid(FALSE);
// RemovePageView() takes care of the delete for us.
@@ -706,7 +706,7 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return;
- if (pSDKDoc->GetPageView(pPage, FALSE)) {
+ if (pSDKDoc->GetPageView(pPage, false)) {
CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;