summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffdocview.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-14 12:13:22 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 19:59:49 +0000
commitf8a943908a414836271a1b7d7e4a97635d941b7f (patch)
tree7f900d57e21c72a67a0347e4f25d0784bdad7c83 /xfa/fxfa/app/xfa_ffdocview.cpp
parent05df075154a832fcb476e1dfcfb865722d0ea898 (diff)
downloadpdfium-f8a943908a414836271a1b7d7e4a97635d941b7f.tar.xz
Replace CXFA_{Object,Node}Array with std::vector
These two ought to happen at the same time as they are intertwined in spots. Remove blatant casts between the two along the way. Change-Id: I9ce5d2faadf1e38aba7cade316560d24a66d8669 Reviewed-on: https://pdfium-review.googlesource.com/2933 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/xfa_ffdocview.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffdocview.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp
index 545afcad00..1447d09140 100644
--- a/xfa/fxfa/app/xfa_ffdocview.cpp
+++ b/xfa/fxfa/app/xfa_ffdocview.cpp
@@ -514,10 +514,9 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName(
return nullptr;
}
if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
- CXFA_Node* pNode = resoveNodeRS.nodes[0]->AsNode();
- if (pNode) {
- return (CXFA_WidgetAcc*)pNode->GetWidgetData();
- }
+ CXFA_Node* pNode = resoveNodeRS.objects.front()->AsNode();
+ if (pNode)
+ return static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData());
}
return nullptr;
}
@@ -722,6 +721,7 @@ bool CXFA_FFDocView::RunEventLayoutReady() {
RunLayout();
return true;
}
+
void CXFA_FFDocView::RunBindItems() {
for (auto* item : m_BindItems) {
if (item->HasRemovedChildren())
@@ -743,9 +743,8 @@ void CXFA_FFDocView::RunBindItems() {
XFA_RESOLVENODE_ALL;
XFA_RESOLVENODE_RS rs;
pScriptContext->ResolveObjects(pWidgetNode, wsRef, rs, dwStyle);
- int32_t iCount = rs.nodes.GetSize();
pAcc->DeleteItem(-1);
- if (rs.dwFlags != XFA_RESOVENODE_RSTYPE_Nodes || iCount < 1)
+ if (rs.dwFlags != XFA_RESOVENODE_RSTYPE_Nodes || rs.objects.empty())
continue;
CFX_WideStringC wsValueRef, wsLabelRef;
@@ -757,12 +756,10 @@ void CXFA_FFDocView::RunBindItems() {
CFX_WideString wsValue;
CFX_WideString wsLabel;
uint32_t uValueHash = FX_HashCode_GetW(wsValueRef, false);
- for (int32_t j = 0; j < iCount; j++) {
- CXFA_Object* refObj = rs.nodes[j];
- if (!refObj->IsNode()) {
+ for (CXFA_Object* refObject : rs.objects) {
+ CXFA_Node* refNode = refObject->AsNode();
+ if (!refNode)
continue;
- }
- CXFA_Node* refNode = refObj->AsNode();
if (bValueUseContent) {
wsValue = refNode->GetContent();
} else {
@@ -785,6 +782,7 @@ void CXFA_FFDocView::RunBindItems() {
}
m_BindItems.clear();
}
+
void CXFA_FFDocView::SetChangeMark() {
if (m_iStatus < XFA_DOCVIEW_LAYOUTSTATUS_End) {
return;