summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_filldata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-14 21:19:44 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-14 21:19:44 +0000
commitaee28693976cc246eea8230a999906802e52cab7 (patch)
tree612e6dbc9b79c978208a623138f70f881acb539f /xfa/fxfa/parser/cxfa_filldata.cpp
parent5a423ef8708e61d43f1556ab09c2e09f496d700d (diff)
downloadpdfium-aee28693976cc246eea8230a999906802e52cab7.tar.xz
Cleanup XFA default value code
This CL adds helper methods to CXFA_Node to retrieve the default values for attributes with the correct data types. Change-Id: I644435b4b430819f1060a95fa4fffe4ba2826cfe Reviewed-on: https://pdfium-review.googlesource.com/18450 Reviewed-by: Tom Sepez <tsepez@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.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/cxfa_filldata.cpp b/xfa/fxfa/parser/cxfa_filldata.cpp
index 65ad3961c2..fbc79ad4d0 100644
--- a/xfa/fxfa/parser/cxfa_filldata.cpp
+++ b/xfa/fxfa/parser/cxfa_filldata.cpp
@@ -31,9 +31,9 @@ void CXFA_FillData::SetColor(FX_ARGB color) {
FX_ARGB CXFA_FillData::GetColor(bool bText) {
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Color, false)) {
- WideStringView wsColor;
+ WideString wsColor;
if (pNode->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false))
- return CXFA_DataData::ToColor(wsColor);
+ return CXFA_DataData::ToColor(wsColor.AsStringView());
}
if (bText)
return 0xFF000000;
@@ -56,9 +56,9 @@ int32_t CXFA_FillData::GetPattern(FX_ARGB& foreColor) {
CXFA_Node* pNode =
m_pNode->JSNode()->GetProperty(0, XFA_Element::Pattern, true);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) {
- WideStringView wsColor;
+ WideString wsColor;
pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false);
- foreColor = CXFA_DataData::ToColor(wsColor);
+ foreColor = CXFA_DataData::ToColor(wsColor.AsStringView());
} else {
foreColor = 0xFF000000;
}
@@ -71,9 +71,9 @@ int32_t CXFA_FillData::GetStipple(FX_ARGB& stippleColor) {
int32_t eAttr = 50;
pNode->JSNode()->TryInteger(XFA_Attribute::Rate, eAttr, true);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) {
- WideStringView wsColor;
+ WideString wsColor;
pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false);
- stippleColor = CXFA_DataData::ToColor(wsColor);
+ stippleColor = CXFA_DataData::ToColor(wsColor.AsStringView());
} else {
stippleColor = 0xFF000000;
}
@@ -86,9 +86,9 @@ int32_t CXFA_FillData::GetLinear(FX_ARGB& endColor) {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToRight;
pNode->JSNode()->TryEnum(XFA_Attribute::Type, eAttr, true);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) {
- WideStringView wsColor;
+ WideString wsColor;
pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false);
- endColor = CXFA_DataData::ToColor(wsColor);
+ endColor = CXFA_DataData::ToColor(wsColor.AsStringView());
} else {
endColor = 0xFF000000;
}
@@ -101,9 +101,9 @@ int32_t CXFA_FillData::GetRadial(FX_ARGB& endColor) {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToEdge;
pNode->JSNode()->TryEnum(XFA_Attribute::Type, eAttr, true);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) {
- WideStringView wsColor;
+ WideString wsColor;
pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false);
- endColor = CXFA_DataData::ToColor(wsColor);
+ endColor = CXFA_DataData::ToColor(wsColor.AsStringView());
} else {
endColor = 0xFF000000;
}