summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_boxdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-13 18:29:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-13 18:29:02 +0000
commit2614250d4f11ed02033a7da095a1694ece12ab78 (patch)
treecc41c5770c17ea47537856991fa44cd1e2acfeb8 /xfa/fxfa/parser/cxfa_boxdata.cpp
parent14768f3264a4cff8ca0096a27e41f1861b2c422b (diff)
downloadpdfium-2614250d4f11ed02033a7da095a1694ece12ab78.tar.xz
Methods are on CJX_Object not CJX_Node now
This CL converts all of the JSNode() to JSObject() calls as all of the original CJX_Node methods have been moved to CJX_Object. This fixes potential bad casts from things like CJX_Content which do not inhert from CJX_Node. Bug: pdfium:793372 Change-Id: I6c7f63a78f3d47bb6bad74faed3fd8c535bf095e Reviewed-on: https://pdfium-review.googlesource.com/21090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_boxdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_boxdata.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/xfa/fxfa/parser/cxfa_boxdata.cpp b/xfa/fxfa/parser/cxfa_boxdata.cpp
index b8a82c2b80..8f2674cda0 100644
--- a/xfa/fxfa/parser/cxfa_boxdata.cpp
+++ b/xfa/fxfa/parser/cxfa_boxdata.cpp
@@ -21,7 +21,7 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) {
int32_t i, j;
for (i = 0, j = 0; i < 4; i++) {
CXFA_CornerData cornerData = CXFA_CornerData(
- pNode->JSNode()->GetProperty(i, XFA_Element::Corner, i == 0));
+ pNode->JSObject()->GetProperty(i, XFA_Element::Corner, i == 0));
if (cornerData.HasValidNode() || i == 0) {
strokes[j] = cornerData;
} else if (!bNull) {
@@ -32,7 +32,7 @@ std::vector<CXFA_StrokeData> GetStrokesInternal(CXFA_Node* pNode, bool bNull) {
}
j++;
CXFA_EdgeData edgeData = CXFA_EdgeData(
- pNode->JSNode()->GetProperty(i, XFA_Element::Edge, i == 0));
+ pNode->JSObject()->GetProperty(i, XFA_Element::Edge, i == 0));
if (edgeData.HasValidNode() || i == 0) {
strokes[j] = edgeData;
} else if (!bNull) {
@@ -79,13 +79,13 @@ static XFA_AttributeEnum Style3D(const std::vector<CXFA_StrokeData>& strokes,
XFA_AttributeEnum CXFA_BoxData::GetHand() const {
if (!m_pNode)
return XFA_AttributeEnum::Even;
- return m_pNode->JSNode()->GetEnum(XFA_Attribute::Hand);
+ return m_pNode->JSObject()->GetEnum(XFA_Attribute::Hand);
}
XFA_AttributeEnum CXFA_BoxData::GetPresence() const {
if (!m_pNode)
return XFA_AttributeEnum::Hidden;
- return m_pNode->JSNode()
+ return m_pNode->JSObject()
->TryEnum(XFA_Attribute::Presence, true)
.value_or(XFA_AttributeEnum::Visible);
}
@@ -97,7 +97,7 @@ int32_t CXFA_BoxData::CountEdges() const {
}
CXFA_EdgeData CXFA_BoxData::GetEdgeData(int32_t nIndex) const {
- return CXFA_EdgeData(m_pNode ? m_pNode->JSNode()->GetProperty(
+ return CXFA_EdgeData(m_pNode ? m_pNode->JSObject()->GetProperty(
nIndex, XFA_Element::Edge, nIndex == 0)
: nullptr);
}
@@ -109,19 +109,19 @@ std::vector<CXFA_StrokeData> CXFA_BoxData::GetStrokes() const {
bool CXFA_BoxData::IsCircular() const {
if (!m_pNode)
return false;
- return m_pNode->JSNode()->GetBoolean(XFA_Attribute::Circular);
+ return m_pNode->JSObject()->GetBoolean(XFA_Attribute::Circular);
}
pdfium::Optional<int32_t> CXFA_BoxData::GetStartAngle() const {
if (!m_pNode)
return {};
- return m_pNode->JSNode()->TryInteger(XFA_Attribute::StartAngle, false);
+ return m_pNode->JSObject()->TryInteger(XFA_Attribute::StartAngle, false);
}
pdfium::Optional<int32_t> CXFA_BoxData::GetSweepAngle() const {
if (!m_pNode)
return {};
- return m_pNode->JSNode()->TryInteger(XFA_Attribute::SweepAngle, false);
+ return m_pNode->JSObject()->TryInteger(XFA_Attribute::SweepAngle, false);
}
CXFA_FillData CXFA_BoxData::GetFillData(bool bModified) const {
@@ -129,7 +129,7 @@ CXFA_FillData CXFA_BoxData::GetFillData(bool bModified) const {
return CXFA_FillData(nullptr);
CXFA_Node* pFillNode =
- m_pNode->JSNode()->GetProperty(0, XFA_Element::Fill, bModified);
+ m_pNode->JSObject()->GetProperty(0, XFA_Element::Fill, bModified);
return CXFA_FillData(pFillNode);
}