summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffdocview.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-01 16:04:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-01 16:04:36 +0000
commite5434b5531f2c081c1d69f67125b6665070ea969 (patch)
tree1fa141f20597c62e9f2e2738d438bfaaecc772a3 /xfa/fxfa/cxfa_ffdocview.cpp
parent3fff90a670d860a7b0319aa0edf8628917d0a122 (diff)
downloadpdfium-e5434b5531f2c081c1d69f67125b6665070ea969.tar.xz
Split JS code out of CXFA_Node.
This CL moves JS code out of CXFA_Node and places it into fxjs/cjx_node. The CXFA_Node then has a CJX_Node as a member and, currently, proxies JS calls to the CJX_Node member. Change-Id: Ic5b95184c8fd2347f0bdcfbccfa89bb6b52835b6 Reviewed-on: https://pdfium-review.googlesource.com/17290 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffdocview.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffdocview.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 603b752d25..a23c7e2958 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -281,7 +281,7 @@ int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam,
: nullptr;
}
if (pValidateNode)
- wsValidateStr = pValidateNode->GetContent();
+ wsValidateStr = pValidateNode->JSNode()->GetContent();
}
if (!wsValidateStr.Contains(L"preSubmit"))
@@ -618,8 +618,8 @@ void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
}
void CXFA_FFDocView::AddCalculateNodeNotify(CXFA_Node* pNodeChange) {
- auto* pGlobalData =
- static_cast<CXFA_CalcData*>(pNodeChange->GetUserData(XFA_CalcData));
+ auto* pGlobalData = static_cast<CXFA_CalcData*>(
+ pNodeChange->JSNode()->GetUserData(XFA_CalcData));
if (!pGlobalData)
return;
@@ -634,10 +634,11 @@ size_t CXFA_FFDocView::RunCalculateRecursive(size_t index) {
CXFA_WidgetAcc* pCurAcc = m_CalculateAccs[index];
AddCalculateNodeNotify(pCurAcc->GetNode());
int32_t iRefCount =
- (int32_t)(uintptr_t)pCurAcc->GetNode()->GetUserData(XFA_CalcRefCount);
+ (int32_t)(uintptr_t)pCurAcc->GetNode()->JSNode()->GetUserData(
+ XFA_CalcRefCount);
iRefCount++;
- pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount,
- (void*)(uintptr_t)iRefCount);
+ pCurAcc->GetNode()->JSNode()->SetUserData(XFA_CalcRefCount,
+ (void*)(uintptr_t)iRefCount);
if (iRefCount > 11)
break;
if (pCurAcc->ProcessCalculate() == XFA_EVENTERROR_Success)
@@ -655,7 +656,8 @@ int32_t CXFA_FFDocView::RunCalculateWidgets() {
RunCalculateRecursive(0);
for (CXFA_WidgetAcc* pCurAcc : m_CalculateAccs)
- pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (void*)(uintptr_t)0);
+ pCurAcc->GetNode()->JSNode()->SetUserData(XFA_CalcRefCount,
+ (void*)(uintptr_t)0);
m_CalculateAccs.clear();
return XFA_EVENTERROR_Success;
@@ -744,19 +746,20 @@ void CXFA_FFDocView::RunBindItems() {
continue;
if (bValueUseContent) {
- wsValue = refNode->GetContent();
+ wsValue = refNode->JSNode()->GetContent();
} else {
CXFA_Node* nodeValue = refNode->GetFirstChildByName(uValueHash);
- wsValue = nodeValue ? nodeValue->GetContent() : refNode->GetContent();
+ wsValue = nodeValue ? nodeValue->JSNode()->GetContent()
+ : refNode->JSNode()->GetContent();
}
if (!bUseValue) {
if (bLabelUseContent) {
- wsLabel = refNode->GetContent();
+ wsLabel = refNode->JSNode()->GetContent();
} else {
CXFA_Node* nodeLabel = refNode->GetFirstChildByName(wsLabelRef);
if (nodeLabel)
- wsLabel = nodeLabel->GetContent();
+ wsLabel = nodeLabel->JSNode()->GetContent();
}
} else {
wsLabel = wsValue;