From 461eeafe191068ac8c32f2717907fc6a22a667d2 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 27 Jul 2016 07:40:05 -0700 Subject: 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 --- fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp') diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp index 42dad4557e..95f0cbe25a 100644 --- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp @@ -503,7 +503,7 @@ void CPDFXFA_Document::WidgetPostAdd(CXFA_FFWidget* hWidget, if (!pXFAPage) return; - m_pSDKDoc->GetPageView(pXFAPage)->AddAnnot(hWidget); + m_pSDKDoc->GetPageView(pXFAPage, true)->AddAnnot(hWidget); } void CPDFXFA_Document::WidgetPreRemove(CXFA_FFWidget* hWidget, @@ -519,7 +519,7 @@ void CPDFXFA_Document::WidgetPreRemove(CXFA_FFWidget* hWidget, if (!pXFAPage) return; - CPDFSDK_PageView* pSdkPageView = m_pSDKDoc->GetPageView(pXFAPage); + CPDFSDK_PageView* pSdkPageView = m_pSDKDoc->GetPageView(pXFAPage, true); if (CPDFSDK_Annot* pAnnot = pSdkPageView->GetAnnotByXFAWidget(hWidget)) pSdkPageView->DeleteAnnot(pAnnot); } -- cgit v1.2.3