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

Unified Diff: xfa/src/fxfa/src/parser/xfa_objectacc_imp.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_objectacc_imp.cpp
diff --git a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp
index e34220b30cebc567f38711ca7914803321517f4e..9261a77ed716e418dc9702824c8726d50c72e02b 100644
--- a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp
@@ -1921,7 +1921,7 @@ void CXFA_WidgetData::SetCheckState(XFA_CHECKSTATE eCheckState,
}
}
CXFA_Node* CXFA_WidgetData::GetExclGroupNode() {
- CXFA_Node* pExcl = (CXFA_Node*)m_pNode->GetNodeItem(XFA_NODEITEM_Parent);
+ CXFA_Node* pExcl = ToNode(m_pNode->GetNodeItem(XFA_NODEITEM_Parent));
if (!pExcl || pExcl->GetClassID() != XFA_ELEMENT_ExclGroup) {
return NULL;
}
@@ -1933,9 +1933,8 @@ CXFA_Node* CXFA_WidgetData::GetSelectedMember() {
if (wsState.IsEmpty()) {
return pSelectedMember;
}
- for (CXFA_Node* pNode =
- (CXFA_Node*)m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
- pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
+ for (CXFA_Node* pNode = ToNode(m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild));
+ pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
CXFA_WidgetData widgetData(pNode);
if (widgetData.GetCheckState() == XFA_CHECKSTATE_On) {
pSelectedMember = pNode;
@@ -1949,9 +1948,8 @@ CXFA_Node* CXFA_WidgetData::SetSelectedMember(const CFX_WideStringC& wsName,
CXFA_Node* pSelectedMember = NULL;
FX_DWORD nameHash =
FX_HashCode_String_GetW(wsName.GetPtr(), wsName.GetLength());
- for (CXFA_Node* pNode =
- (CXFA_Node*)m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
- pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
+ for (CXFA_Node* pNode = ToNode(m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild));
+ pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pNode->GetNameHash() == nameHash) {
CXFA_WidgetData widgetData(pNode);
widgetData.SetCheckState(XFA_CHECKSTATE_On, bNotify);

Powered by Google App Engine
This is Rietveld 408576698