Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1234)

Unified Diff: xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp

Issue 1668003003: Call CXFA_Object::ToNode() rather than C-style casting. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
index 0d5dfb4b075a680a3084c109e184f9b1051cea15..5f30d75ad414187ff3e6dc3fc7157bbc4d3321f4 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
@@ -293,7 +293,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot,
bTargetAllFind = FALSE;
if (wsTargetExpr.GetAt(0) == '#') {
CXFA_Node* pNode = pDocument->GetNodeByID(
- (CXFA_Node*)pDocument->GetXFAObject(XFA_HASHCODE_Template),
+ ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Template)),
wsTargetExpr.Mid(1));
if (pNode) {
return pNode;
@@ -311,7 +311,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot,
XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings |
XFA_RESOLVENODE_Parent);
if (iCount > 0 && rs.nodes[0]->IsNode()) {
- return (CXFA_Node*)rs.nodes[0];
+ return rs.nodes[0]->AsNode();
}
}
iSpliteIndex = iSpliteNextIndex;
@@ -1739,7 +1739,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
}
pContainerItem->m_pFormNode = pDocument->DataMerge_CopyContainer(
pContainerItem->m_pFormNode, pParentNode,
- (CXFA_Node*)pDocument->GetXFAObject(XFA_HASHCODE_Record), TRUE);
+ ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)), TRUE);
} break;
case XFA_ELEMENT_ContentArea: {
CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode;
@@ -1760,7 +1760,8 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
}
if (!pPendingPageSet->GetNodeItem(XFA_NODEITEM_Parent)) {
CXFA_Node* pFormToplevelSubform =
- ((CXFA_Node*)pDocument->GetXFAObject(XFA_HASHCODE_Form))
+ pDocument->GetXFAObject(XFA_HASHCODE_Form)
+ ->AsNode()
->GetFirstChildByClass(XFA_ELEMENT_Subform);
pFormToplevelSubform->InsertChild(pPendingPageSet);
}

Powered by Google App Engine
This is Rietveld 408576698