diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-23 17:02:23 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-23 17:02:23 +0000 |
commit | 6aec70bc09cb65b169fe6ca1af65e8929aeea43a (patch) | |
tree | 34d55cf15cba0fe71e87a896184ecdc891d4752f /xfa/fxfa/parser/cxfa_captiondata.cpp | |
parent | d49254bc9323883deba14d27026ec2bb9af096fa (diff) | |
download | pdfium-6aec70bc09cb65b169fe6ca1af65e8929aeea43a.tar.xz |
Cleanup CXFA_WidgetDatachromium/3277
This CL cleans up return values, out-params and changes simple methods
to boolean checks where possible in CXFA_WidgetData.
Change-Id: I29daa67993730f3e9d61cb6fdf918a886cc9120e
Reviewed-on: https://pdfium-review.googlesource.com/19230
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_captiondata.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_captiondata.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_captiondata.cpp b/xfa/fxfa/parser/cxfa_captiondata.cpp index 1553a50e00..61bcbcefa1 100644 --- a/xfa/fxfa/parser/cxfa_captiondata.cpp +++ b/xfa/fxfa/parser/cxfa_captiondata.cpp @@ -11,13 +11,19 @@ CXFA_CaptionData::CXFA_CaptionData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -int32_t CXFA_CaptionData::GetPresence() const { +bool CXFA_CaptionData::IsVisible() const { return m_pNode->JSNode() - ->TryEnum(XFA_Attribute::Presence, true) - .value_or(XFA_ATTRIBUTEENUM_Visible); + ->TryEnum(XFA_Attribute::Presence, true) + .value_or(XFA_ATTRIBUTEENUM_Visible) == XFA_ATTRIBUTEENUM_Visible; } -int32_t CXFA_CaptionData::GetPlacementType() const { +bool CXFA_CaptionData::IsHidden() const { + return m_pNode->JSNode() + ->TryEnum(XFA_Attribute::Presence, true) + .value_or(XFA_ATTRIBUTEENUM_Visible) == XFA_ATTRIBUTEENUM_Hidden; +} + +XFA_ATTRIBUTEENUM CXFA_CaptionData::GetPlacementType() const { return m_pNode->JSNode() ->TryEnum(XFA_Attribute::Placement, true) .value_or(XFA_ATTRIBUTEENUM_Left); |