summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_strokedata.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_strokedata.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_strokedata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_strokedata.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/xfa/fxfa/parser/cxfa_strokedata.cpp b/xfa/fxfa/parser/cxfa_strokedata.cpp
index a0e80cdd5a..96d2866c37 100644
--- a/xfa/fxfa/parser/cxfa_strokedata.cpp
+++ b/xfa/fxfa/parser/cxfa_strokedata.cpp
@@ -14,7 +14,7 @@ bool CXFA_StrokeData::IsVisible() const {
if (!m_pNode)
return false;
- XFA_AttributeEnum presence = m_pNode->JSNode()
+ XFA_AttributeEnum presence = m_pNode->JSObject()
->TryEnum(XFA_Attribute::Presence, true)
.value_or(XFA_AttributeEnum::Visible);
return presence == XFA_AttributeEnum::Visible;
@@ -23,11 +23,11 @@ bool CXFA_StrokeData::IsVisible() const {
XFA_AttributeEnum CXFA_StrokeData::GetCapType() const {
if (!m_pNode)
return XFA_AttributeEnum::Square;
- return m_pNode->JSNode()->GetEnum(XFA_Attribute::Cap);
+ return m_pNode->JSObject()->GetEnum(XFA_Attribute::Cap);
}
XFA_AttributeEnum CXFA_StrokeData::GetStrokeType() const {
- return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_Attribute::Stroke)
+ return m_pNode ? m_pNode->JSObject()->GetEnum(XFA_Attribute::Stroke)
: XFA_AttributeEnum::Solid;
}
@@ -36,7 +36,7 @@ float CXFA_StrokeData::GetThickness() const {
}
CXFA_Measurement CXFA_StrokeData::GetMSThickness() const {
- return m_pNode ? m_pNode->JSNode()->GetMeasure(XFA_Attribute::Thickness)
+ return m_pNode ? m_pNode->JSObject()->GetMeasure(XFA_Attribute::Thickness)
: CXFA_Measurement(0.5, XFA_Unit::Pt);
}
@@ -44,7 +44,7 @@ void CXFA_StrokeData::SetMSThickness(CXFA_Measurement msThinkness) {
if (!m_pNode)
return;
- m_pNode->JSNode()->SetMeasure(XFA_Attribute::Thickness, msThinkness, false);
+ m_pNode->JSObject()->SetMeasure(XFA_Attribute::Thickness, msThinkness, false);
}
FX_ARGB CXFA_StrokeData::GetColor() const {
@@ -56,7 +56,7 @@ FX_ARGB CXFA_StrokeData::GetColor() const {
return 0xFF000000;
return CXFA_DataData::ToColor(
- pNode->JSNode()->GetCData(XFA_Attribute::Value).AsStringView());
+ pNode->JSObject()->GetCData(XFA_Attribute::Value).AsStringView());
}
void CXFA_StrokeData::SetColor(FX_ARGB argb) {
@@ -64,29 +64,29 @@ void CXFA_StrokeData::SetColor(FX_ARGB argb) {
return;
CXFA_Node* pNode =
- m_pNode->JSNode()->GetProperty(0, XFA_Element::Color, true);
+ m_pNode->JSObject()->GetProperty(0, XFA_Element::Color, true);
int a;
int r;
int g;
int b;
std::tie(a, r, g, b) = ArgbDecode(argb);
- pNode->JSNode()->SetCData(XFA_Attribute::Value,
- WideString::Format(L"%d,%d,%d", r, g, b), false,
- false);
+ pNode->JSObject()->SetCData(XFA_Attribute::Value,
+ WideString::Format(L"%d,%d,%d", r, g, b), false,
+ false);
}
XFA_AttributeEnum CXFA_StrokeData::GetJoinType() const {
- return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_Attribute::Join)
+ return m_pNode ? m_pNode->JSObject()->GetEnum(XFA_Attribute::Join)
: XFA_AttributeEnum::Square;
}
bool CXFA_StrokeData::IsInverted() const {
- return m_pNode ? m_pNode->JSNode()->GetBoolean(XFA_Attribute::Inverted)
+ return m_pNode ? m_pNode->JSObject()->GetBoolean(XFA_Attribute::Inverted)
: false;
}
float CXFA_StrokeData::GetRadius() const {
- return m_pNode ? m_pNode->JSNode()
+ return m_pNode ? m_pNode->JSObject()
->TryMeasure(XFA_Attribute::Radius, true)
.value_or(CXFA_Measurement(0, XFA_Unit::In))
.ToUnit(XFA_Unit::Pt)