summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_strokedata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-08 18:01:31 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-08 18:01:31 +0000
commit1d86501aa9ee49890fbb43db60333a42f947cd74 (patch)
tree65b0c342fa74b11371a640c4444b87b6d6a6f5ba /xfa/fxfa/parser/cxfa_strokedata.cpp
parent7055dffad92bd7be7cdb20ed12d5cc5890177e7a (diff)
downloadpdfium-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_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 1f8a56ea12..0579eef621 100644
--- a/xfa/fxfa/parser/cxfa_strokedata.cpp
+++ b/xfa/fxfa/parser/cxfa_strokedata.cpp
@@ -11,18 +11,18 @@
#include "xfa/fxfa/parser/xfa_utils.h"
int32_t CXFA_StrokeData::GetPresence() const {
- return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Presence)
+ return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_Attribute::Presence)
: XFA_ATTRIBUTEENUM_Invisible;
}
int32_t CXFA_StrokeData::GetCapType() const {
if (!m_pNode)
return XFA_ATTRIBUTEENUM_Square;
- return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Cap);
+ return m_pNode->JSNode()->GetEnum(XFA_Attribute::Cap);
}
int32_t CXFA_StrokeData::GetStrokeType() const {
- return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Stroke)
+ return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_Attribute::Stroke)
: XFA_ATTRIBUTEENUM_Solid;
}
@@ -31,17 +31,17 @@ float CXFA_StrokeData::GetThickness() const {
}
CXFA_Measurement CXFA_StrokeData::GetMSThickness() const {
- return m_pNode ? m_pNode->JSNode()->GetMeasure(XFA_ATTRIBUTE_Thickness)
- : XFA_GetAttributeDefaultValue_Measure(XFA_Element::Edge,
- XFA_ATTRIBUTE_Thickness,
- XFA_XDPPACKET_Form);
+ return m_pNode ? m_pNode->JSNode()->GetMeasure(XFA_Attribute::Thickness)
+ : XFA_GetAttributeDefaultValue_Measure(
+ XFA_Element::Edge, XFA_Attribute::Thickness,
+ XFA_XDPPACKET_Form);
}
void CXFA_StrokeData::SetMSThickness(CXFA_Measurement msThinkness) {
if (!m_pNode)
return;
- m_pNode->JSNode()->SetMeasure(XFA_ATTRIBUTE_Thickness, msThinkness, false);
+ m_pNode->JSNode()->SetMeasure(XFA_Attribute::Thickness, msThinkness, false);
}
FX_ARGB CXFA_StrokeData::GetColor() const {
@@ -53,7 +53,7 @@ FX_ARGB CXFA_StrokeData::GetColor() const {
return 0xFF000000;
WideStringView wsColor;
- pNode->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, true);
+ pNode->JSNode()->TryCData(XFA_Attribute::Value, wsColor, true);
return CXFA_Data::ToColor(wsColor);
}
@@ -70,22 +70,22 @@ void CXFA_StrokeData::SetColor(FX_ARGB argb) {
int b;
std::tie(a, r, g, b) = ArgbDecode(argb);
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);
}
int32_t CXFA_StrokeData::GetJoinType() const {
- return m_pNode ? m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Join)
+ return m_pNode ? m_pNode->JSNode()->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->JSNode()->GetBoolean(XFA_Attribute::Inverted)
: false;
}
float CXFA_StrokeData::GetRadius() const {
return m_pNode ? m_pNode->JSNode()
- ->GetMeasure(XFA_ATTRIBUTE_Radius)
+ ->GetMeasure(XFA_Attribute::Radius)
.ToUnit(XFA_UNIT_Pt)
: 0;
}