summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_box.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/parser/cxfa_box.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/parser/cxfa_box.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_box.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index 300edd01ad..3753108243 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -22,8 +22,8 @@ void GetStrokesInternal(CXFA_Node* pNode,
strokes->resize(8);
int32_t i, j;
for (i = 0, j = 0; i < 4; i++) {
- CXFA_Corner corner =
- CXFA_Corner(pNode->GetProperty(i, XFA_Element::Corner, i == 0));
+ CXFA_Corner corner = CXFA_Corner(
+ pNode->JSNode()->GetProperty(i, XFA_Element::Corner, i == 0));
if (corner || i == 0) {
(*strokes)[j] = corner;
} else if (!bNull) {
@@ -34,7 +34,7 @@ void GetStrokesInternal(CXFA_Node* pNode,
}
j++;
CXFA_Edge edge =
- CXFA_Edge(pNode->GetProperty(i, XFA_Element::Edge, i == 0));
+ CXFA_Edge(pNode->JSNode()->GetProperty(i, XFA_Element::Edge, i == 0));
if (edge || i == 0) {
(*strokes)[j] = edge;
} else if (!bNull) {
@@ -78,13 +78,13 @@ static int32_t Style3D(const std::vector<CXFA_Stroke>& strokes,
int32_t CXFA_Box::GetHand() const {
if (!m_pNode)
return XFA_ATTRIBUTEENUM_Even;
- return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand);
+ return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Hand);
}
int32_t CXFA_Box::GetPresence() const {
if (!m_pNode)
return XFA_ATTRIBUTEENUM_Hidden;
- return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence);
+ return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Presence);
}
int32_t CXFA_Box::CountEdges() const {
@@ -94,9 +94,9 @@ int32_t CXFA_Box::CountEdges() const {
}
CXFA_Edge CXFA_Box::GetEdge(int32_t nIndex) const {
- return CXFA_Edge(
- m_pNode ? m_pNode->GetProperty(nIndex, XFA_Element::Edge, nIndex == 0)
- : nullptr);
+ return CXFA_Edge(m_pNode ? m_pNode->JSNode()->GetProperty(
+ nIndex, XFA_Element::Edge, nIndex == 0)
+ : nullptr);
}
void CXFA_Box::GetStrokes(std::vector<CXFA_Stroke>* strokes) const {
@@ -106,7 +106,7 @@ void CXFA_Box::GetStrokes(std::vector<CXFA_Stroke>* strokes) const {
bool CXFA_Box::IsCircular() const {
if (!m_pNode)
return false;
- return m_pNode->GetBoolean(XFA_ATTRIBUTE_Circular);
+ return m_pNode->JSNode()->GetBoolean(XFA_ATTRIBUTE_Circular);
}
bool CXFA_Box::GetStartAngle(float& fStartAngle) const {
@@ -115,7 +115,8 @@ bool CXFA_Box::GetStartAngle(float& fStartAngle) const {
return false;
CXFA_Measurement ms;
- bool bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_StartAngle, ms, false);
+ bool bRet =
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_StartAngle, ms, false);
if (bRet)
fStartAngle = ms.GetValue();
@@ -128,7 +129,8 @@ bool CXFA_Box::GetSweepAngle(float& fSweepAngle) const {
return false;
CXFA_Measurement ms;
- bool bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_SweepAngle, ms, false);
+ bool bRet =
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SweepAngle, ms, false);
if (bRet)
fSweepAngle = ms.GetValue();
@@ -139,7 +141,8 @@ CXFA_Fill CXFA_Box::GetFill(bool bModified) const {
if (!m_pNode)
return CXFA_Fill(nullptr);
- CXFA_Node* pFillNode = m_pNode->GetProperty(0, XFA_Element::Fill, bModified);
+ CXFA_Node* pFillNode =
+ m_pNode->JSNode()->GetProperty(0, XFA_Element::Fill, bModified);
return CXFA_Fill(pFillNode);
}