summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-08 15:47:33 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-08 21:09:35 +0000
commit88c8e2fe2076fa4b5088b912dd92c3b2a56bb3ec (patch)
tree3e7359b0b3d00a6afc60744428f579d8b2d01a33 /xfa/fxfa/parser
parent94fc2af0c9a800f39e4dbcac859f1ad490f7d725 (diff)
downloadpdfium-88c8e2fe2076fa4b5088b912dd92c3b2a56bb3ec.tar.xz
Differentiate the type of LayoutItem to create
This CL splits CXFA_FFNotify::OnCreateLayoutItem into a Content and Container variant. This removes the need for casting at the two call sites. Change-Id: Ic19bf4398f0ea32099c270f3bb585a18004ccb5d Reviewed-on: https://pdfium-review.googlesource.com/22412 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp6
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.cpp3
2 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
index bd21cdcf11..398a5e8f7c 100644
--- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
+++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
@@ -1184,9 +1184,9 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem(
m_pOldLayoutItem = m_pOldLayoutItem->m_pNext;
return pLayoutItem;
}
- pLayoutItem = (CXFA_ContentLayoutItem*)pFormNode->GetDocument()
- ->GetNotify()
- ->OnCreateLayoutItem(pFormNode);
+ pLayoutItem =
+ pFormNode->GetDocument()->GetNotify()->OnCreateContentLayoutItem(
+ pFormNode);
CXFA_ContentLayoutItem* pPrevLayoutItem =
static_cast<CXFA_ContentLayoutItem*>(
pFormNode->JSObject()->GetLayoutItem());
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index 61caae762f..20902906f0 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -580,8 +580,7 @@ void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord,
pNewPageAreaLayoutItem = pContainerItem;
} else {
CXFA_FFNotify* pNotify = pNewPageArea->GetDocument()->GetNotify();
- auto* pContainerItem = static_cast<CXFA_ContainerLayoutItem*>(
- pNotify->OnCreateLayoutItem(pNewPageArea));
+ auto* pContainerItem = pNotify->OnCreateContainerLayoutItem(pNewPageArea);
m_PageArray.push_back(pContainerItem);
m_nAvailPages++;
pNotify->OnPageEvent(pContainerItem, XFA_PAGEVIEWEVENT_PostRemoved);