summaryrefslogtreecommitdiff
path: root/xfa
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 /xfa
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 'xfa')
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffnotify.cpp8
-rw-r--r--xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp8
2 files changed, 10 insertions, 6 deletions
diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
index a65819de22..9dd93f387a 100644
--- a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp
@@ -615,12 +615,12 @@ void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_FFDocView* pDocView,
void* pParam2) {
CXFA_FFWidget* pWidget = static_cast<CXFA_FFWidget*>(pSender);
pDocView->DeleteLayoutItem(pWidget);
- if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) {
+ if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End)
return;
- }
m_pDoc->GetDocProvider()->WidgetEvent(pWidget, pWidget->GetDataAcc(),
- XFA_WIDGETEVENT_PreRemoved, NULL, NULL);
- pWidget->AddInvalidateRect(NULL);
+ XFA_WIDGETEVENT_PreRemoved, nullptr,
+ pWidget->GetPageView());
+ pWidget->AddInvalidateRect(nullptr);
}
void CXFA_FFNotify::OnLayoutItemRectChanged(CXFA_FFDocView* pDocView,
IXFA_DocLayout* pLayout,
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp
index 00908944b2..8e0a9444c5 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp
@@ -40,14 +40,18 @@ FX_DWORD XFA_GetRelevant(CXFA_Node* pFormItem, FX_DWORD dwParentRelvant) {
}
void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) {
CXFA_LayoutItem* pNode = pLayoutItem->m_pFirstChild;
+ IXFA_Notify* pNotify =
+ pLayoutItem->m_pFormNode->GetDocument()->GetParser()->GetNotify();
+ IXFA_DocLayout* pDocLayout =
+ pLayoutItem->m_pFormNode->GetDocument()->GetDocLayout();
while (pNode) {
CXFA_LayoutItem* pNext = pNode->m_pNextSibling;
pNode->m_pParent = nullptr;
+ pNotify->OnLayoutEvent(pDocLayout, static_cast<CXFA_LayoutItem*>(pNode),
+ XFA_LAYOUTEVENT_ItemRemoving);
XFA_ReleaseLayoutItem(pNode);
pNode = pNext;
}
- IXFA_Notify* pNotify =
- pLayoutItem->m_pFormNode->GetDocument()->GetParser()->GetNotify();
if (pLayoutItem->m_pFormNode->GetClassID() == XFA_ELEMENT_PageArea) {
pNotify->OnPageEvent(static_cast<CXFA_ContainerLayoutItem*>(pLayoutItem),
XFA_PAGEEVENT_PageRemoved);