summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_filldata.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_filldata.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_filldata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_filldata.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/xfa/fxfa/parser/cxfa_filldata.cpp b/xfa/fxfa/parser/cxfa_filldata.cpp
index b4ca99735f..2ea7652784 100644
--- a/xfa/fxfa/parser/cxfa_filldata.cpp
+++ b/xfa/fxfa/parser/cxfa_filldata.cpp
@@ -13,7 +13,7 @@ CXFA_FillData::CXFA_FillData(CXFA_Node* pNode) : CXFA_DataData(pNode) {}
CXFA_FillData::~CXFA_FillData() {}
bool CXFA_FillData::IsVisible() const {
- return m_pNode->JSNode()
+ return m_pNode->JSObject()
->TryEnum(XFA_Attribute::Presence, true)
.value_or(XFA_AttributeEnum::Visible) ==
XFA_AttributeEnum::Visible;
@@ -21,21 +21,21 @@ bool CXFA_FillData::IsVisible() const {
void CXFA_FillData::SetColor(FX_ARGB color) {
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(color);
- 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);
}
FX_ARGB CXFA_FillData::GetColor(bool bText) const {
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Color, false)) {
pdfium::Optional<WideString> wsColor =
- pNode->JSNode()->TryCData(XFA_Attribute::Value, false);
+ pNode->JSObject()->TryCData(XFA_Attribute::Value, false);
if (wsColor)
return CXFA_DataData::ToColor(wsColor->AsStringView());
}
@@ -57,14 +57,14 @@ XFA_Element CXFA_FillData::GetFillType() const {
}
XFA_AttributeEnum CXFA_FillData::GetPatternType() const {
- return GetPattern()->JSNode()->GetEnum(XFA_Attribute::Type);
+ return GetPattern()->JSObject()->GetEnum(XFA_Attribute::Type);
}
FX_ARGB CXFA_FillData::GetPatternColor() const {
if (CXFA_Node* pColor =
GetPattern()->GetChild(0, XFA_Element::Color, false)) {
pdfium::Optional<WideString> wsColor =
- pColor->JSNode()->TryCData(XFA_Attribute::Value, false);
+ pColor->JSObject()->TryCData(XFA_Attribute::Value, false);
if (wsColor)
return CXFA_DataData::ToColor(wsColor->AsStringView());
}
@@ -73,7 +73,7 @@ FX_ARGB CXFA_FillData::GetPatternColor() const {
int32_t CXFA_FillData::GetStippleRate() const {
return GetStipple()
- ->JSNode()
+ ->JSObject()
->TryInteger(XFA_Attribute::Rate, true)
.value_or(50);
}
@@ -82,7 +82,7 @@ FX_ARGB CXFA_FillData::GetStippleColor() const {
if (CXFA_Node* pColor =
GetStipple()->GetChild(0, XFA_Element::Color, false)) {
pdfium::Optional<WideString> wsColor =
- pColor->JSNode()->TryCData(XFA_Attribute::Value, false);
+ pColor->JSObject()->TryCData(XFA_Attribute::Value, false);
if (wsColor)
return CXFA_DataData::ToColor(wsColor->AsStringView());
}
@@ -91,7 +91,7 @@ FX_ARGB CXFA_FillData::GetStippleColor() const {
XFA_AttributeEnum CXFA_FillData::GetLinearType() const {
return GetLinear()
- ->JSNode()
+ ->JSObject()
->TryEnum(XFA_Attribute::Type, true)
.value_or(XFA_AttributeEnum::ToRight);
}
@@ -99,7 +99,7 @@ XFA_AttributeEnum CXFA_FillData::GetLinearType() const {
FX_ARGB CXFA_FillData::GetLinearColor() const {
if (CXFA_Node* pColor = GetLinear()->GetChild(0, XFA_Element::Color, false)) {
pdfium::Optional<WideString> wsColor =
- pColor->JSNode()->TryCData(XFA_Attribute::Value, false);
+ pColor->JSObject()->TryCData(XFA_Attribute::Value, false);
if (wsColor)
return CXFA_DataData::ToColor(wsColor->AsStringView());
}
@@ -108,7 +108,7 @@ FX_ARGB CXFA_FillData::GetLinearColor() const {
bool CXFA_FillData::IsRadialToEdge() const {
return GetRadial()
- ->JSNode()
+ ->JSObject()
->TryEnum(XFA_Attribute::Type, true)
.value_or(XFA_AttributeEnum::ToEdge) == XFA_AttributeEnum::ToEdge;
}
@@ -116,7 +116,7 @@ bool CXFA_FillData::IsRadialToEdge() const {
FX_ARGB CXFA_FillData::GetRadialColor() const {
if (CXFA_Node* pColor = GetRadial()->GetChild(0, XFA_Element::Color, false)) {
pdfium::Optional<WideString> wsColor =
- pColor->JSNode()->TryCData(XFA_Attribute::Value, false);
+ pColor->JSObject()->TryCData(XFA_Attribute::Value, false);
if (wsColor)
return CXFA_DataData::ToColor(wsColor->AsStringView());
}
@@ -124,17 +124,17 @@ FX_ARGB CXFA_FillData::GetRadialColor() const {
}
CXFA_Node* CXFA_FillData::GetStipple() const {
- return m_pNode->JSNode()->GetProperty(0, XFA_Element::Stipple, true);
+ return m_pNode->JSObject()->GetProperty(0, XFA_Element::Stipple, true);
}
CXFA_Node* CXFA_FillData::GetRadial() const {
- return m_pNode->JSNode()->GetProperty(0, XFA_Element::Radial, true);
+ return m_pNode->JSObject()->GetProperty(0, XFA_Element::Radial, true);
}
CXFA_Node* CXFA_FillData::GetLinear() const {
- return m_pNode->JSNode()->GetProperty(0, XFA_Element::Linear, true);
+ return m_pNode->JSObject()->GetProperty(0, XFA_Element::Linear, true);
}
CXFA_Node* CXFA_FillData::GetPattern() const {
- return m_pNode->JSNode()->GetProperty(0, XFA_Element::Pattern, true);
+ return m_pNode->JSObject()->GetProperty(0, XFA_Element::Pattern, true);
}