From d718d634b7aa3311a5b6298574d06f091365259f Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 30 Jul 2018 19:31:19 +0000 Subject: Type-safe iteration over CXFA_ContentLayoutItems. There's no reason that every CXFA_LayoutItem must be a CXFA_ContentLayout item, so use checked conversions. The code may already be arranging things so the constraint is already satisfied, but this adds an additional layer of safety. Tidy some long expressions with pre-existing typedef for node iterator while we're at it. Change-Id: If1448131ca73bfedb2266b070f1a913688598e64 Reviewed-on: https://pdfium-review.googlesource.com/39051 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- xfa/fxfa/parser/cxfa_layoutitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xfa/fxfa/parser/cxfa_layoutitem.cpp') diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp index aac7e5db41..42294a508b 100644 --- a/xfa/fxfa/parser/cxfa_layoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp @@ -28,7 +28,7 @@ void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) { } pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem); if (pLayoutItem->GetFormNode()->GetElementType() == XFA_Element::PageArea) { - pNotify->OnPageEvent(static_cast(pLayoutItem), + pNotify->OnPageEvent(ToContainerLayoutItem(pLayoutItem), XFA_PAGEVIEWEVENT_PostRemoved); } delete pLayoutItem; -- cgit v1.2.3