diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-08 18:01:31 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-08 18:01:31 +0000 |
commit | 1d86501aa9ee49890fbb43db60333a42f947cd74 (patch) | |
tree | 65b0c342fa74b11371a640c4444b87b6d6a6f5ba /xfa/fxfa/parser/cxfa_filldata.cpp | |
parent | 7055dffad92bd7be7cdb20ed12d5cc5890177e7a (diff) | |
download | pdfium-1d86501aa9ee49890fbb43db60333a42f947cd74.tar.xz |
Convert XFA_ATTRIBUTE to an enum class
This CL converts the XFA_ATTRIBUTE enum to an enum class and fixes up
various usages.
Change-Id: I3dd17cc412d97eb212a65ce63bb9fa19605e1e91
Reviewed-on: https://pdfium-review.googlesource.com/18050
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.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/cxfa_filldata.cpp b/xfa/fxfa/parser/cxfa_filldata.cpp index 772b1151c3..bdce5d604e 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_Data(pNode) {} CXFA_FillData::~CXFA_FillData() {} int32_t CXFA_FillData::GetPresence() { - return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Presence); + return m_pNode->JSNode()->GetEnum(XFA_Attribute::Presence); } void CXFA_FillData::SetColor(FX_ARGB color) { @@ -26,13 +26,13 @@ void CXFA_FillData::SetColor(FX_ARGB color) { int b; std::tie(a, r, g, b) = ArgbDecode(color); wsColor.Format(L"%d,%d,%d", r, g, b); - pNode->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsColor, false, false); + pNode->JSNode()->SetCData(XFA_Attribute::Value, wsColor, false, false); } FX_ARGB CXFA_FillData::GetColor(bool bText) { if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Color, false)) { WideStringView wsColor; - if (pNode->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false)) + if (pNode->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false)) return CXFA_Data::ToColor(wsColor); } if (bText) @@ -57,22 +57,22 @@ int32_t CXFA_FillData::GetPattern(FX_ARGB& foreColor) { m_pNode->JSNode()->GetProperty(0, XFA_Element::Pattern, true); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) { WideStringView wsColor; - pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false); foreColor = CXFA_Data::ToColor(wsColor); } else { foreColor = 0xFF000000; } - return pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Type); + return pNode->JSNode()->GetEnum(XFA_Attribute::Type); } int32_t CXFA_FillData::GetStipple(FX_ARGB& stippleColor) { CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Stipple, true); int32_t eAttr = 50; - pNode->JSNode()->TryInteger(XFA_ATTRIBUTE_Rate, eAttr, true); + pNode->JSNode()->TryInteger(XFA_Attribute::Rate, eAttr, true); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) { WideStringView wsColor; - pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false); stippleColor = CXFA_Data::ToColor(wsColor); } else { stippleColor = 0xFF000000; @@ -84,10 +84,10 @@ int32_t CXFA_FillData::GetLinear(FX_ARGB& endColor) { CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Linear, true); XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToRight; - pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr, true); + pNode->JSNode()->TryEnum(XFA_Attribute::Type, eAttr, true); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) { WideStringView wsColor; - pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false); endColor = CXFA_Data::ToColor(wsColor); } else { endColor = 0xFF000000; @@ -99,10 +99,10 @@ int32_t CXFA_FillData::GetRadial(FX_ARGB& endColor) { CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Radial, true); XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToEdge; - pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr, true); + pNode->JSNode()->TryEnum(XFA_Attribute::Type, eAttr, true); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) { WideStringView wsColor; - pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_Attribute::Value, wsColor, false); endColor = CXFA_Data::ToColor(wsColor); } else { endColor = 0xFF000000; |